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

package com.azure.resourcemanager.hybridcontainerservice.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hybridcontainerservice.models.VirtualNetworksPropertiesInfraVnetProfile;
import com.azure.resourcemanager.hybridcontainerservice.models.VirtualNetworksPropertiesInfraVnetProfileHci;
import com.azure.resourcemanager.hybridcontainerservice.models.VirtualNetworksPropertiesInfraVnetProfileNetworkCloud;
import com.azure.resourcemanager.hybridcontainerservice.models.VirtualNetworksPropertiesInfraVnetProfileVmware;
import org.junit.jupiter.api.Assertions;

public final class VirtualNetworksPropertiesInfraVnetProfileTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VirtualNetworksPropertiesInfraVnetProfile model =
            BinaryData
                .fromString(
                    "{\"hci\":{\"mocGroup\":\"akufgmjz\",\"mocLocation\":\"rdgrtw\",\"mocVnetName\":\"nuuzkopbm\"},\"networkCloud\":{\"networkId\":\"fdwoyuhh\"},\"vmware\":{\"segmentName\":\"iefozbhdmsml\"}}")
                .toObject(VirtualNetworksPropertiesInfraVnetProfile.class);
        Assertions.assertEquals("akufgmjz", model.hci().mocGroup());
        Assertions.assertEquals("rdgrtw", model.hci().mocLocation());
        Assertions.assertEquals("nuuzkopbm", model.hci().mocVnetName());
        Assertions.assertEquals("fdwoyuhh", model.networkCloud().networkId());
        Assertions.assertEquals("iefozbhdmsml", model.vmware().segmentName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VirtualNetworksPropertiesInfraVnetProfile model =
            new VirtualNetworksPropertiesInfraVnetProfile()
                .withHci(
                    new VirtualNetworksPropertiesInfraVnetProfileHci()
                        .withMocGroup("akufgmjz")
                        .withMocLocation("rdgrtw")
                        .withMocVnetName("nuuzkopbm"))
                .withNetworkCloud(new VirtualNetworksPropertiesInfraVnetProfileNetworkCloud().withNetworkId("fdwoyuhh"))
                .withVmware(new VirtualNetworksPropertiesInfraVnetProfileVmware().withSegmentName("iefozbhdmsml"));
        model = BinaryData.fromObject(model).toObject(VirtualNetworksPropertiesInfraVnetProfile.class);
        Assertions.assertEquals("akufgmjz", model.hci().mocGroup());
        Assertions.assertEquals("rdgrtw", model.hci().mocLocation());
        Assertions.assertEquals("nuuzkopbm", model.hci().mocVnetName());
        Assertions.assertEquals("fdwoyuhh", model.networkCloud().networkId());
        Assertions.assertEquals("iefozbhdmsml", model.vmware().segmentName());
    }
}
