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

public final class CustomizationIpSettingsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CustomizationIpSettings model =
            BinaryData
                .fromString(
                    "{\"gateway\":[\"ewzsyyceuzsoib\",\"ud\"],\"ip\":{\"argument\":\"xtrthz\",\"ipAddress\":\"ytdw\",\"type\":\"DHCP_IP\"},\"subnetMask\":\"qu\"}")
                .toObject(CustomizationIpSettings.class);
        Assertions.assertEquals("ewzsyyceuzsoib", model.gateway().get(0));
        Assertions.assertEquals("xtrthz", model.ip().argument());
        Assertions.assertEquals("ytdw", model.ip().ipAddress());
        Assertions.assertEquals(CustomizationIpAddressType.DHCP_IP, model.ip().type());
        Assertions.assertEquals("qu", model.subnetMask());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CustomizationIpSettings model =
            new CustomizationIpSettings()
                .withGateway(Arrays.asList("ewzsyyceuzsoib", "ud"))
                .withIp(
                    new CustomizationIpAddress()
                        .withArgument("xtrthz")
                        .withIpAddress("ytdw")
                        .withType(CustomizationIpAddressType.DHCP_IP))
                .withSubnetMask("qu");
        model = BinaryData.fromObject(model).toObject(CustomizationIpSettings.class);
        Assertions.assertEquals("ewzsyyceuzsoib", model.gateway().get(0));
        Assertions.assertEquals("xtrthz", model.ip().argument());
        Assertions.assertEquals("ytdw", model.ip().ipAddress());
        Assertions.assertEquals(CustomizationIpAddressType.DHCP_IP, model.ip().type());
        Assertions.assertEquals("qu", model.subnetMask());
    }
}
