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

package com.azure.resourcemanager.resourcemover.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.resourcemover.models.LBFrontendIpConfigurationResourceSettings;
import com.azure.resourcemanager.resourcemover.models.SubnetReference;
import org.junit.jupiter.api.Assertions;

public final class LBFrontendIpConfigurationResourceSettingsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LBFrontendIpConfigurationResourceSettings model =
            BinaryData
                .fromString(
                    "{\"name\":\"cmgyud\",\"privateIpAddress\":\"tlmoyrx\",\"privateIpAllocationMethod\":\"fudwpznt\",\"subnet\":{\"name\":\"zhlrqjb\",\"sourceArmResourceId\":\"ck\"},\"zones\":\"lhrxsbkyvpyc\"}")
                .toObject(LBFrontendIpConfigurationResourceSettings.class);
        Assertions.assertEquals("cmgyud", model.name());
        Assertions.assertEquals("tlmoyrx", model.privateIpAddress());
        Assertions.assertEquals("fudwpznt", model.privateIpAllocationMethod());
        Assertions.assertEquals("ck", model.subnet().sourceArmResourceId());
        Assertions.assertEquals("zhlrqjb", model.subnet().name());
        Assertions.assertEquals("lhrxsbkyvpyc", model.zones());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LBFrontendIpConfigurationResourceSettings model =
            new LBFrontendIpConfigurationResourceSettings()
                .withName("cmgyud")
                .withPrivateIpAddress("tlmoyrx")
                .withPrivateIpAllocationMethod("fudwpznt")
                .withSubnet(new SubnetReference().withSourceArmResourceId("ck").withName("zhlrqjb"))
                .withZones("lhrxsbkyvpyc");
        model = BinaryData.fromObject(model).toObject(LBFrontendIpConfigurationResourceSettings.class);
        Assertions.assertEquals("cmgyud", model.name());
        Assertions.assertEquals("tlmoyrx", model.privateIpAddress());
        Assertions.assertEquals("fudwpznt", model.privateIpAllocationMethod());
        Assertions.assertEquals("ck", model.subnet().sourceArmResourceId());
        Assertions.assertEquals("zhlrqjb", model.subnet().name());
        Assertions.assertEquals("lhrxsbkyvpyc", model.zones());
    }
}
