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

package com.azure.resourcemanager.managednetworkfabric.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackSkuInner;
import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackRoleName;
import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackSkusListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class NetworkRackSkusListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NetworkRackSkusListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"roleName\":\"AggregateRack\",\"maximumServerCount\":674250391,\"maximumStorageCount\":968271036,\"maximumUplinks\":517735759,\"networkDevices\":[],\"provisioningState\":\"Deleting\"},\"id\":\"pmzznrtffya\",\"name\":\"itmhhei\",\"type\":\"qaqhvseufu\"}],\"nextLink\":\"rxpdlcgqlsi\"}")
                .toObject(NetworkRackSkusListResult.class);
        Assertions.assertEquals(NetworkRackRoleName.AGGREGATE_RACK, model.value().get(0).roleName());
        Assertions.assertEquals(674250391, model.value().get(0).maximumServerCount());
        Assertions.assertEquals(968271036, model.value().get(0).maximumStorageCount());
        Assertions.assertEquals(517735759, model.value().get(0).maximumUplinks());
        Assertions.assertEquals("rxpdlcgqlsi", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NetworkRackSkusListResult model =
            new NetworkRackSkusListResult()
                .withValue(
                    Arrays
                        .asList(
                            new NetworkRackSkuInner()
                                .withRoleName(NetworkRackRoleName.AGGREGATE_RACK)
                                .withMaximumServerCount(674250391)
                                .withMaximumStorageCount(968271036)
                                .withMaximumUplinks(517735759)
                                .withNetworkDevices(Arrays.asList())))
                .withNextLink("rxpdlcgqlsi");
        model = BinaryData.fromObject(model).toObject(NetworkRackSkusListResult.class);
        Assertions.assertEquals(NetworkRackRoleName.AGGREGATE_RACK, model.value().get(0).roleName());
        Assertions.assertEquals(674250391, model.value().get(0).maximumServerCount());
        Assertions.assertEquals(968271036, model.value().get(0).maximumStorageCount());
        Assertions.assertEquals(517735759, model.value().get(0).maximumUplinks());
        Assertions.assertEquals("rxpdlcgqlsi", model.nextLink());
    }
}
