// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.support.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.support.fluent.models.ServiceInner;
import com.azure.resourcemanager.support.models.ServicesListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ServicesListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ServicesListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"id\":\"m\",\"name\":\"fp\",\"type\":\"qobmtukk\",\"properties\":{\"displayName\":\"rtihfxtijbpz\",\"resourceTypes\":[]}},{\"id\":\"wzsymglzufcy\",\"name\":\"ohdbihanufh\",\"type\":\"bj\",\"properties\":{\"displayName\":\"git\",\"resourceTypes\":[]}},{\"id\":\"hab\",\"name\":\"pikxwczbyscnpqxu\",\"type\":\"vyq\",\"properties\":{\"displayName\":\"b\",\"resourceTypes\":[]}},{\"id\":\"k\",\"name\":\"dumjgrtfwvuk\",\"type\":\"audccsnhs\",\"properties\":{\"displayName\":\"yejhk\",\"resourceTypes\":[]}}]}")
                .toObject(ServicesListResult.class);
        Assertions.assertEquals("rtihfxtijbpz", model.value().get(0).displayName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ServicesListResult model =
            new ServicesListResult()
                .withValue(
                    Arrays
                        .asList(
                            new ServiceInner().withDisplayName("rtihfxtijbpz").withResourceTypes(Arrays.asList()),
                            new ServiceInner().withDisplayName("git").withResourceTypes(Arrays.asList()),
                            new ServiceInner().withDisplayName("b").withResourceTypes(Arrays.asList()),
                            new ServiceInner().withDisplayName("yejhk").withResourceTypes(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(ServicesListResult.class);
        Assertions.assertEquals("rtihfxtijbpz", model.value().get(0).displayName());
    }
}
