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

package com.azure.resourcemanager.hdinsight.containers.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterPoolVersionInner;
import com.azure.resourcemanager.hdinsight.containers.models.ClusterPoolVersionsListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ClusterPoolVersionsListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ClusterPoolVersionsListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"clusterPoolVersion\":\"wntoegokdwbwh\",\"aksVersion\":\"z\",\"isPreview\":false},\"id\":\"rvexztvb\",\"name\":\"qgsfraoyzkoow\",\"type\":\"lmnguxaw\"},{\"properties\":{\"clusterPoolVersion\":\"dsyuuximerqfob\",\"aksVersion\":\"znkbykutwpfhpagm\",\"isPreview\":true},\"id\":\"kdsnfdsdoakgtdl\",\"name\":\"kkze\",\"type\":\"dlhewp\"},{\"properties\":{\"clusterPoolVersion\":\"sttwvogvbbe\",\"aksVersion\":\"cngqqmoakufgmjz\",\"isPreview\":false},\"id\":\"dgrtwaenuuzkopbm\",\"name\":\"nrfdw\",\"type\":\"yuhhziu\"}],\"nextLink\":\"fozbhdmsmlmzqhof\"}")
                .toObject(ClusterPoolVersionsListResult.class);
        Assertions.assertEquals("wntoegokdwbwh", model.value().get(0).clusterPoolVersion());
        Assertions.assertEquals("z", model.value().get(0).aksVersion());
        Assertions.assertEquals(false, model.value().get(0).isPreview());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ClusterPoolVersionsListResult model =
            new ClusterPoolVersionsListResult()
                .withValue(
                    Arrays
                        .asList(
                            new ClusterPoolVersionInner()
                                .withClusterPoolVersion("wntoegokdwbwh")
                                .withAksVersion("z")
                                .withIsPreview(false),
                            new ClusterPoolVersionInner()
                                .withClusterPoolVersion("dsyuuximerqfob")
                                .withAksVersion("znkbykutwpfhpagm")
                                .withIsPreview(true),
                            new ClusterPoolVersionInner()
                                .withClusterPoolVersion("sttwvogvbbe")
                                .withAksVersion("cngqqmoakufgmjz")
                                .withIsPreview(false)));
        model = BinaryData.fromObject(model).toObject(ClusterPoolVersionsListResult.class);
        Assertions.assertEquals("wntoegokdwbwh", model.value().get(0).clusterPoolVersion());
        Assertions.assertEquals("z", model.value().get(0).aksVersion());
        Assertions.assertEquals(false, model.value().get(0).isPreview());
    }
}
