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

package com.azure.resourcemanager.workloads.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.workloads.models.DiskSku;
import com.azure.resourcemanager.workloads.models.DiskSkuName;
import com.azure.resourcemanager.workloads.models.DiskVolumeConfiguration;
import org.junit.jupiter.api.Assertions;

public final class DiskVolumeConfigurationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DiskVolumeConfiguration model =
            BinaryData
                .fromString(
                    "{\"count\":2263722670392996598,\"sizeGB\":8352976901787855054,\"sku\":{\"name\":\"Premium_ZRS\"}}")
                .toObject(DiskVolumeConfiguration.class);
        Assertions.assertEquals(2263722670392996598L, model.count());
        Assertions.assertEquals(8352976901787855054L, model.sizeGB());
        Assertions.assertEquals(DiskSkuName.PREMIUM_ZRS, model.sku().name());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DiskVolumeConfiguration model =
            new DiskVolumeConfiguration()
                .withCount(2263722670392996598L)
                .withSizeGB(8352976901787855054L)
                .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_ZRS));
        model = BinaryData.fromObject(model).toObject(DiskVolumeConfiguration.class);
        Assertions.assertEquals(2263722670392996598L, model.count());
        Assertions.assertEquals(8352976901787855054L, model.sizeGB());
        Assertions.assertEquals(DiskSkuName.PREMIUM_ZRS, model.sku().name());
    }
}
