// 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.VirtualMachineTemplateInner;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualMachineTemplateListResponse;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class VirtualMachineTemplateListResponseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VirtualMachineTemplateListResponse model =
            BinaryData
                .fromString(
                    "{\"nextLink\":\"sbzkf\",\"value\":[{\"id\":\"v\",\"location\":\"qi\",\"name\":\"invkjjxdxrbuu\",\"properties\":{\"amountOfRam\":733421396,\"controllers\":[],\"description\":\"yhmlwpaztzp\",\"disks\":[],\"exposeToGuestVM\":true,\"guestOS\":\"kwyfzqwhxxbuyqax\",\"guestOSType\":\"eqz\",\"nics\":[],\"numberOfCores\":802122315,\"path\":\"o\",\"privateCloudId\":\"xorjaltolmncwsob\",\"vSphereNetworks\":[],\"vSphereTags\":[],\"vmwaretools\":\"dbnw\"},\"type\":\"fhucqdpfuv\"},{\"id\":\"sbjjc\",\"location\":\"vxb\",\"name\":\"vudutncor\",\"properties\":{\"amountOfRam\":1945766703,\"controllers\":[],\"description\":\"vcofudfl\",\"disks\":[],\"exposeToGuestVM\":false,\"guestOS\":\"bgdknnqv\",\"guestOSType\":\"znqntoru\",\"nics\":[],\"numberOfCores\":1449495124,\"path\":\"hmk\",\"privateCloudId\":\"c\",\"vSphereNetworks\":[],\"vSphereTags\":[],\"vmwaretools\":\"wjue\"},\"type\":\"eburu\"},{\"id\":\"movsmzlxwabmqoe\",\"location\":\"ifrvtpu\",\"name\":\"jmqlgkfb\",\"properties\":{\"amountOfRam\":2059272755,\"controllers\":[],\"description\":\"n\",\"disks\":[],\"exposeToGuestVM\":false,\"guestOS\":\"tujitcjedft\",\"guestOSType\":\"ae\",\"nics\":[],\"numberOfCores\":1301478988,\"path\":\"dcpzfoqo\",\"privateCloudId\":\"i\",\"vSphereNetworks\":[],\"vSphereTags\":[],\"vmwaretools\":\"arz\"},\"type\":\"zuf\"},{\"id\":\"ciqopidoa\",\"location\":\"iodhkhazxkhnz\",\"name\":\"nlwntoe\",\"properties\":{\"amountOfRam\":2078888236,\"controllers\":[],\"description\":\"whkszzcmrvexztvb\",\"disks\":[],\"exposeToGuestVM\":true,\"guestOS\":\"ra\",\"guestOSType\":\"zkoowtlmnguxawqa\",\"nics\":[],\"numberOfCores\":2048944312,\"path\":\"uximerqfobw\",\"privateCloudId\":\"znkbykutwpfhpagm\",\"vSphereNetworks\":[],\"vSphereTags\":[],\"vmwaretools\":\"dsnfdsdoakgtdl\"},\"type\":\"kzevdlhewpusds\"}]}")
                .toObject(VirtualMachineTemplateListResponse.class);
        Assertions.assertEquals("sbzkf", model.nextLink());
        Assertions.assertEquals("qi", model.value().get(0).location());
        Assertions.assertEquals(733421396, model.value().get(0).amountOfRam());
        Assertions.assertEquals("yhmlwpaztzp", model.value().get(0).description());
        Assertions.assertEquals(true, model.value().get(0).exposeToGuestVM());
        Assertions.assertEquals(802122315, model.value().get(0).numberOfCores());
        Assertions.assertEquals("o", model.value().get(0).path());
        Assertions.assertEquals("xorjaltolmncwsob", model.value().get(0).privateCloudId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VirtualMachineTemplateListResponse model =
            new VirtualMachineTemplateListResponse()
                .withNextLink("sbzkf")
                .withValue(
                    Arrays
                        .asList(
                            new VirtualMachineTemplateInner()
                                .withLocation("qi")
                                .withAmountOfRam(733421396)
                                .withControllers(Arrays.asList())
                                .withDescription("yhmlwpaztzp")
                                .withDisks(Arrays.asList())
                                .withExposeToGuestVM(true)
                                .withNics(Arrays.asList())
                                .withNumberOfCores(802122315)
                                .withPath("o")
                                .withPrivateCloudId("xorjaltolmncwsob")
                                .withVSphereNetworks(Arrays.asList())
                                .withVSphereTags(Arrays.asList()),
                            new VirtualMachineTemplateInner()
                                .withLocation("vxb")
                                .withAmountOfRam(1945766703)
                                .withControllers(Arrays.asList())
                                .withDescription("vcofudfl")
                                .withDisks(Arrays.asList())
                                .withExposeToGuestVM(false)
                                .withNics(Arrays.asList())
                                .withNumberOfCores(1449495124)
                                .withPath("hmk")
                                .withPrivateCloudId("c")
                                .withVSphereNetworks(Arrays.asList())
                                .withVSphereTags(Arrays.asList()),
                            new VirtualMachineTemplateInner()
                                .withLocation("ifrvtpu")
                                .withAmountOfRam(2059272755)
                                .withControllers(Arrays.asList())
                                .withDescription("n")
                                .withDisks(Arrays.asList())
                                .withExposeToGuestVM(false)
                                .withNics(Arrays.asList())
                                .withNumberOfCores(1301478988)
                                .withPath("dcpzfoqo")
                                .withPrivateCloudId("i")
                                .withVSphereNetworks(Arrays.asList())
                                .withVSphereTags(Arrays.asList()),
                            new VirtualMachineTemplateInner()
                                .withLocation("iodhkhazxkhnz")
                                .withAmountOfRam(2078888236)
                                .withControllers(Arrays.asList())
                                .withDescription("whkszzcmrvexztvb")
                                .withDisks(Arrays.asList())
                                .withExposeToGuestVM(true)
                                .withNics(Arrays.asList())
                                .withNumberOfCores(2048944312)
                                .withPath("uximerqfobw")
                                .withPrivateCloudId("znkbykutwpfhpagm")
                                .withVSphereNetworks(Arrays.asList())
                                .withVSphereTags(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(VirtualMachineTemplateListResponse.class);
        Assertions.assertEquals("sbzkf", model.nextLink());
        Assertions.assertEquals("qi", model.value().get(0).location());
        Assertions.assertEquals(733421396, model.value().get(0).amountOfRam());
        Assertions.assertEquals("yhmlwpaztzp", model.value().get(0).description());
        Assertions.assertEquals(true, model.value().get(0).exposeToGuestVM());
        Assertions.assertEquals(802122315, model.value().get(0).numberOfCores());
        Assertions.assertEquals("o", model.value().get(0).path());
        Assertions.assertEquals("xorjaltolmncwsob", model.value().get(0).privateCloudId());
    }
}
