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

package com.azure.resourcemanager.hdinsight.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hdinsight.models.VmSizeProperty;
import org.junit.jupiter.api.Assertions;

public final class VmSizePropertyTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VmSizeProperty model =
            BinaryData
                .fromString(
                    "{\"name\":\"ydxtqm\",\"cores\":323647852,\"dataDiskStorageTier\":\"orgguf\",\"label\":\"aomtbghhavgrvkff\",\"maxDataDiskCount\":5595663447131926478,\"memoryInMb\":3841332379064621298,\"supportedByVirtualMachines\":true,\"supportedByWebWorkerRoles\":true,\"virtualMachineResourceDiskSizeInMb\":6764739063385765952,\"webWorkerResourceDiskSizeInMb\":7551905176757776284}")
                .toObject(VmSizeProperty.class);
        Assertions.assertEquals("ydxtqm", model.name());
        Assertions.assertEquals(323647852, model.cores());
        Assertions.assertEquals("orgguf", model.dataDiskStorageTier());
        Assertions.assertEquals("aomtbghhavgrvkff", model.label());
        Assertions.assertEquals(5595663447131926478L, model.maxDataDiskCount());
        Assertions.assertEquals(3841332379064621298L, model.memoryInMb());
        Assertions.assertEquals(true, model.supportedByVirtualMachines());
        Assertions.assertEquals(true, model.supportedByWebWorkerRoles());
        Assertions.assertEquals(6764739063385765952L, model.virtualMachineResourceDiskSizeInMb());
        Assertions.assertEquals(7551905176757776284L, model.webWorkerResourceDiskSizeInMb());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VmSizeProperty model =
            new VmSizeProperty()
                .withName("ydxtqm")
                .withCores(323647852)
                .withDataDiskStorageTier("orgguf")
                .withLabel("aomtbghhavgrvkff")
                .withMaxDataDiskCount(5595663447131926478L)
                .withMemoryInMb(3841332379064621298L)
                .withSupportedByVirtualMachines(true)
                .withSupportedByWebWorkerRoles(true)
                .withVirtualMachineResourceDiskSizeInMb(6764739063385765952L)
                .withWebWorkerResourceDiskSizeInMb(7551905176757776284L);
        model = BinaryData.fromObject(model).toObject(VmSizeProperty.class);
        Assertions.assertEquals("ydxtqm", model.name());
        Assertions.assertEquals(323647852, model.cores());
        Assertions.assertEquals("orgguf", model.dataDiskStorageTier());
        Assertions.assertEquals("aomtbghhavgrvkff", model.label());
        Assertions.assertEquals(5595663447131926478L, model.maxDataDiskCount());
        Assertions.assertEquals(3841332379064621298L, model.memoryInMb());
        Assertions.assertEquals(true, model.supportedByVirtualMachines());
        Assertions.assertEquals(true, model.supportedByWebWorkerRoles());
        Assertions.assertEquals(6764739063385765952L, model.virtualMachineResourceDiskSizeInMb());
        Assertions.assertEquals(7551905176757776284L, model.webWorkerResourceDiskSizeInMb());
    }
}
