// 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.NetworkFunctionVendorInner;
import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner;
import com.azure.resourcemanager.hybridnetwork.models.SkuType;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class NetworkFunctionVendorInnerTests {
    @Test
    public void testDeserialize() {
        NetworkFunctionVendorInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"vendorName\":\"i\",\"skuList\":[{\"skuName\":\"kdvjsll\",\"skuType\":\"Firewall\"},{\"skuName\":\"d\",\"skuType\":\"EvolvedPacketCore\"},{\"skuName\":\"kpnpulexxbczwtr\",\"skuType\":\"EvolvedPacketCore\"}]}}")
                .toObject(NetworkFunctionVendorInner.class);
        Assertions.assertEquals("i", model.vendorName());
        Assertions.assertEquals("kdvjsll", model.skuList().get(0).skuName());
        Assertions.assertEquals(SkuType.FIREWALL, model.skuList().get(0).skuType());
    }

    @Test
    public void testSerialize() {
        NetworkFunctionVendorInner model =
            new NetworkFunctionVendorInner()
                .withVendorName("i")
                .withSkuList(
                    Arrays
                        .asList(
                            new SkuOverviewInner().withSkuName("kdvjsll").withSkuType(SkuType.FIREWALL),
                            new SkuOverviewInner().withSkuName("d").withSkuType(SkuType.EVOLVED_PACKET_CORE),
                            new SkuOverviewInner()
                                .withSkuName("kpnpulexxbczwtr")
                                .withSkuType(SkuType.EVOLVED_PACKET_CORE)));
        model = BinaryData.fromObject(model).toObject(NetworkFunctionVendorInner.class);
        Assertions.assertEquals("i", model.vendorName());
        Assertions.assertEquals("kdvjsll", model.skuList().get(0).skuName());
        Assertions.assertEquals(SkuType.FIREWALL, model.skuList().get(0).skuType());
    }
}
