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

package com.azure.resourcemanager.networkcloud.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.networkcloud.models.ClusterCapacity;
import org.junit.jupiter.api.Assertions;

public final class ClusterCapacityTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ClusterCapacity model =
            BinaryData
                .fromString(
                    "{\"availableApplianceStorageGB\":7907185604336465635,\"availableCoreCount\":2765498262416383294,\"availableHostStorageGB\":8209102913227721734,\"availableMemoryGB\":1794402231326230823,\"totalApplianceStorageGB\":995169380729931769,\"totalCoreCount\":5158531315830549218,\"totalHostStorageGB\":1275613767570140789,\"totalMemoryGB\":6939449275608814243}")
                .toObject(ClusterCapacity.class);
        Assertions.assertEquals(7907185604336465635L, model.availableApplianceStorageGB());
        Assertions.assertEquals(2765498262416383294L, model.availableCoreCount());
        Assertions.assertEquals(8209102913227721734L, model.availableHostStorageGB());
        Assertions.assertEquals(1794402231326230823L, model.availableMemoryGB());
        Assertions.assertEquals(995169380729931769L, model.totalApplianceStorageGB());
        Assertions.assertEquals(5158531315830549218L, model.totalCoreCount());
        Assertions.assertEquals(1275613767570140789L, model.totalHostStorageGB());
        Assertions.assertEquals(6939449275608814243L, model.totalMemoryGB());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ClusterCapacity model =
            new ClusterCapacity()
                .withAvailableApplianceStorageGB(7907185604336465635L)
                .withAvailableCoreCount(2765498262416383294L)
                .withAvailableHostStorageGB(8209102913227721734L)
                .withAvailableMemoryGB(1794402231326230823L)
                .withTotalApplianceStorageGB(995169380729931769L)
                .withTotalCoreCount(5158531315830549218L)
                .withTotalHostStorageGB(1275613767570140789L)
                .withTotalMemoryGB(6939449275608814243L);
        model = BinaryData.fromObject(model).toObject(ClusterCapacity.class);
        Assertions.assertEquals(7907185604336465635L, model.availableApplianceStorageGB());
        Assertions.assertEquals(2765498262416383294L, model.availableCoreCount());
        Assertions.assertEquals(8209102913227721734L, model.availableHostStorageGB());
        Assertions.assertEquals(1794402231326230823L, model.availableMemoryGB());
        Assertions.assertEquals(995169380729931769L, model.totalApplianceStorageGB());
        Assertions.assertEquals(5158531315830549218L, model.totalCoreCount());
        Assertions.assertEquals(1275613767570140789L, model.totalHostStorageGB());
        Assertions.assertEquals(6939449275608814243L, model.totalMemoryGB());
    }
}
