// 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.NetworkFunctionSkuDetails;
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 NetworkFunctionSkuDetailsTests {
    @Test
    public void testDeserialize() {
        NetworkFunctionSkuDetails model =
            BinaryData
                .fromString(
                    "{\"skuType\":\"Unknown\",\"value\":[{\"roleName\":\"svexcsonpclhoco\",\"networkInterfaces\":[]}],\"nextLink\":\"leggzfbu\"}")
                .toObject(NetworkFunctionSkuDetails.class);
        Assertions.assertEquals(SkuType.UNKNOWN, model.skuType());
        Assertions.assertEquals("svexcsonpclhoco", model.value().get(0).roleName());
    }

    @Test
    public void testSerialize() {
        NetworkFunctionSkuDetails model =
            new NetworkFunctionSkuDetails()
                .withSkuType(SkuType.UNKNOWN)
                .withValue(
                    Arrays
                        .asList(
                            new NetworkFunctionSkuRoleDetailsInner()
                                .withRoleName("svexcsonpclhoco")
                                .withNetworkInterfaces(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(NetworkFunctionSkuDetails.class);
        Assertions.assertEquals(SkuType.UNKNOWN, model.skuType());
        Assertions.assertEquals("svexcsonpclhoco", model.value().get(0).roleName());
    }
}
