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

package com.azure.resourcemanager.hybridcompute.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hybridcompute.models.LocationData;
import com.azure.resourcemanager.hybridcompute.models.MachineUpdateProperties;
import org.junit.jupiter.api.Assertions;

public final class MachineUpdatePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MachineUpdateProperties model =
            BinaryData
                .fromString(
                    "{\"locationData\":{\"name\":\"hdwbavxbniwdjs\",\"city\":\"tsdbpgn\",\"district\":\"txhp\",\"countryOrRegion\":\"bzpfzab\"},\"parentClusterResourceId\":\"cuh\",\"privateLinkScopeResourceId\":\"tcty\"}")
                .toObject(MachineUpdateProperties.class);
        Assertions.assertEquals("hdwbavxbniwdjs", model.locationData().name());
        Assertions.assertEquals("tsdbpgn", model.locationData().city());
        Assertions.assertEquals("txhp", model.locationData().district());
        Assertions.assertEquals("bzpfzab", model.locationData().countryOrRegion());
        Assertions.assertEquals("cuh", model.parentClusterResourceId());
        Assertions.assertEquals("tcty", model.privateLinkScopeResourceId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MachineUpdateProperties model =
            new MachineUpdateProperties()
                .withLocationData(
                    new LocationData()
                        .withName("hdwbavxbniwdjs")
                        .withCity("tsdbpgn")
                        .withDistrict("txhp")
                        .withCountryOrRegion("bzpfzab"))
                .withParentClusterResourceId("cuh")
                .withPrivateLinkScopeResourceId("tcty");
        model = BinaryData.fromObject(model).toObject(MachineUpdateProperties.class);
        Assertions.assertEquals("hdwbavxbniwdjs", model.locationData().name());
        Assertions.assertEquals("tsdbpgn", model.locationData().city());
        Assertions.assertEquals("txhp", model.locationData().district());
        Assertions.assertEquals("bzpfzab", model.locationData().countryOrRegion());
        Assertions.assertEquals("cuh", model.parentClusterResourceId());
        Assertions.assertEquals("tcty", model.privateLinkScopeResourceId());
    }
}
