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

public final class CustomizationNicSettingTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CustomizationNicSetting model =
            BinaryData
                .fromString(
                    "{\"adapter\":{\"gateway\":[\"dgssofwqmzqal\"],\"ip\":{\"argument\":\"njijpxacqqudf\",\"ipAddress\":\"yxbaaabjyvayf\",\"type\":\"CUSTOM\"},\"subnetMask\":\"zrtuzq\"},\"macAddress\":\"sexnevfdnw\"}")
                .toObject(CustomizationNicSetting.class);
        Assertions.assertEquals("dgssofwqmzqal", model.adapter().gateway().get(0));
        Assertions.assertEquals("njijpxacqqudf", model.adapter().ip().argument());
        Assertions.assertEquals("yxbaaabjyvayf", model.adapter().ip().ipAddress());
        Assertions.assertEquals(CustomizationIpAddressType.CUSTOM, model.adapter().ip().type());
        Assertions.assertEquals("zrtuzq", model.adapter().subnetMask());
        Assertions.assertEquals("sexnevfdnw", model.macAddress());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CustomizationNicSetting model =
            new CustomizationNicSetting()
                .withAdapter(
                    new CustomizationIpSettings()
                        .withGateway(Arrays.asList("dgssofwqmzqal"))
                        .withIp(
                            new CustomizationIpAddress()
                                .withArgument("njijpxacqqudf")
                                .withIpAddress("yxbaaabjyvayf")
                                .withType(CustomizationIpAddressType.CUSTOM))
                        .withSubnetMask("zrtuzq"))
                .withMacAddress("sexnevfdnw");
        model = BinaryData.fromObject(model).toObject(CustomizationNicSetting.class);
        Assertions.assertEquals("dgssofwqmzqal", model.adapter().gateway().get(0));
        Assertions.assertEquals("njijpxacqqudf", model.adapter().ip().argument());
        Assertions.assertEquals("yxbaaabjyvayf", model.adapter().ip().ipAddress());
        Assertions.assertEquals(CustomizationIpAddressType.CUSTOM, model.adapter().ip().type());
        Assertions.assertEquals("zrtuzq", model.adapter().subnetMask());
        Assertions.assertEquals("sexnevfdnw", model.macAddress());
    }
}
