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

package com.azure.resourcemanager.containerservicefleet.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetMemberInner;
import com.azure.resourcemanager.containerservicefleet.models.FleetMemberListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class FleetMemberListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        FleetMemberListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"clusterResourceId\":\"nuvamiheogna\",\"group\":\"zxtheotusivyevcc\",\"provisioningState\":\"Succeeded\"},\"eTag\":\"nhungbw\",\"id\":\"rnfygxgispem\",\"name\":\"tzfkufubl\",\"type\":\"ofx\"},{\"properties\":{\"clusterResourceId\":\"ofjaeqjhqjb\",\"group\":\"v\",\"provisioningState\":\"Succeeded\"},\"eTag\":\"qulngsntnbybkzgc\",\"id\":\"wclxxwrl\",\"name\":\"douskcqvkocrcjdk\",\"type\":\"tnhxbn\"},{\"properties\":{\"clusterResourceId\":\"iksqr\",\"group\":\"ssainqpjwnzll\",\"provisioningState\":\"Failed\"},\"eTag\":\"pee\",\"id\":\"mgxsab\",\"name\":\"yqduujit\",\"type\":\"jczdzevndh\"}],\"nextLink\":\"wpdappdsbdkv\"}")
                .toObject(FleetMemberListResult.class);
        Assertions.assertEquals("nuvamiheogna", model.value().get(0).clusterResourceId());
        Assertions.assertEquals("zxtheotusivyevcc", model.value().get(0).group());
        Assertions.assertEquals("wpdappdsbdkv", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        FleetMemberListResult model =
            new FleetMemberListResult()
                .withValue(
                    Arrays
                        .asList(
                            new FleetMemberInner().withClusterResourceId("nuvamiheogna").withGroup("zxtheotusivyevcc"),
                            new FleetMemberInner().withClusterResourceId("ofjaeqjhqjb").withGroup("v"),
                            new FleetMemberInner().withClusterResourceId("iksqr").withGroup("ssainqpjwnzll")))
                .withNextLink("wpdappdsbdkv");
        model = BinaryData.fromObject(model).toObject(FleetMemberListResult.class);
        Assertions.assertEquals("nuvamiheogna", model.value().get(0).clusterResourceId());
        Assertions.assertEquals("zxtheotusivyevcc", model.value().get(0).group());
        Assertions.assertEquals("wpdappdsbdkv", model.nextLink());
    }
}
