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

package com.azure.resourcemanager.hybridnetwork.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner;
import com.azure.resourcemanager.hybridnetwork.models.NetworkInterface;
import com.azure.resourcemanager.hybridnetwork.models.VMSwitchType;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class NetworkFunctionSkuRoleDetailsInnerTests {
    @Test
    public void testDeserialize() {
        NetworkFunctionSkuRoleDetailsInner model =
            BinaryData
                .fromString(
                    "{\"roleName\":\"mvfaxkffeiith\",\"networkInterfaces\":[{\"networkInterfaceName\":\"v\",\"macAddress\":\"xmzsbbzogg\",\"ipConfigurations\":[],\"vmSwitchType\":\"Lan\"}]}")
                .toObject(NetworkFunctionSkuRoleDetailsInner.class);
        Assertions.assertEquals("mvfaxkffeiith", model.roleName());
        Assertions.assertEquals("v", model.networkInterfaces().get(0).networkInterfaceName());
        Assertions.assertEquals("xmzsbbzogg", model.networkInterfaces().get(0).macAddress());
        Assertions.assertEquals(VMSwitchType.LAN, model.networkInterfaces().get(0).vmSwitchType());
    }

    @Test
    public void testSerialize() {
        NetworkFunctionSkuRoleDetailsInner model =
            new NetworkFunctionSkuRoleDetailsInner()
                .withRoleName("mvfaxkffeiith")
                .withNetworkInterfaces(
                    Arrays
                        .asList(
                            new NetworkInterface()
                                .withNetworkInterfaceName("v")
                                .withMacAddress("xmzsbbzogg")
                                .withIpConfigurations(Arrays.asList())
                                .withVmSwitchType(VMSwitchType.LAN)));
        model = BinaryData.fromObject(model).toObject(NetworkFunctionSkuRoleDetailsInner.class);
        Assertions.assertEquals("mvfaxkffeiith", model.roleName());
        Assertions.assertEquals("v", model.networkInterfaces().get(0).networkInterfaceName());
        Assertions.assertEquals("xmzsbbzogg", model.networkInterfaces().get(0).macAddress());
        Assertions.assertEquals(VMSwitchType.LAN, model.networkInterfaces().get(0).vmSwitchType());
    }
}
