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

package com.azure.resourcemanager.vmwarecloudsimple.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.ResourcePoolInner;
import com.azure.resourcemanager.vmwarecloudsimple.models.ResourcePoolsListResponse;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ResourcePoolsListResponseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ResourcePoolsListResponse model =
            BinaryData
                .fromString(
                    "{\"nextLink\":\"oruzfgsquyfxrxx\",\"value\":[{\"id\":\"tramxjez\",\"location\":\"wnwxuqlcvyd\",\"name\":\"atdooaojkniod\",\"privateCloudId\":\"oebwnujhemms\",\"properties\":{\"fullName\":\"kcrodtjinfw\"},\"type\":\"fltkacjv\"},{\"id\":\"f\",\"location\":\"lfoakg\",\"name\":\"fpagaowpulp\",\"privateCloudId\":\"lyls\",\"properties\":{\"fullName\":\"qjnsjervtia\"},\"type\":\"sdszue\"}]}")
                .toObject(ResourcePoolsListResponse.class);
        Assertions.assertEquals("oruzfgsquyfxrxx", model.nextLink());
        Assertions.assertEquals("tramxjez", model.value().get(0).id());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ResourcePoolsListResponse model =
            new ResourcePoolsListResponse()
                .withNextLink("oruzfgsquyfxrxx")
                .withValue(
                    Arrays.asList(new ResourcePoolInner().withId("tramxjez"), new ResourcePoolInner().withId("f")));
        model = BinaryData.fromObject(model).toObject(ResourcePoolsListResponse.class);
        Assertions.assertEquals("oruzfgsquyfxrxx", model.nextLink());
        Assertions.assertEquals("tramxjez", model.value().get(0).id());
    }
}
