// 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.SkuOverviewInner;
import com.azure.resourcemanager.hybridnetwork.fluent.models.VendorDetails;
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 VendorDetailsTests {
    @Test
    public void testDeserialize() {
        VendorDetails model =
            BinaryData
                .fromString(
                    "{\"vendorName\":\"zb\",\"skuList\":[{\"skuName\":\"ovm\",\"skuType\":\"EvolvedPacketCore\"},{\"skuName\":\"cspkwlhzdobpxjmf\",\"skuType\":\"SDWAN\"},{\"skuName\":\"nchrkcciww\",\"skuType\":\"SDWAN\"}]}")
                .toObject(VendorDetails.class);
        Assertions.assertEquals("zb", model.vendorName());
        Assertions.assertEquals("ovm", model.skuList().get(0).skuName());
        Assertions.assertEquals(SkuType.EVOLVED_PACKET_CORE, model.skuList().get(0).skuType());
    }

    @Test
    public void testSerialize() {
        VendorDetails model =
            new VendorDetails()
                .withVendorName("zb")
                .withSkuList(
                    Arrays
                        .asList(
                            new SkuOverviewInner().withSkuName("ovm").withSkuType(SkuType.EVOLVED_PACKET_CORE),
                            new SkuOverviewInner().withSkuName("cspkwlhzdobpxjmf").withSkuType(SkuType.SDWAN),
                            new SkuOverviewInner().withSkuName("nchrkcciww").withSkuType(SkuType.SDWAN)));
        model = BinaryData.fromObject(model).toObject(VendorDetails.class);
        Assertions.assertEquals("zb", model.vendorName());
        Assertions.assertEquals("ovm", model.skuList().get(0).skuName());
        Assertions.assertEquals(SkuType.EVOLVED_PACKET_CORE, model.skuList().get(0).skuType());
    }
}
