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

package com.azure.resourcemanager.devtestlabs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devtestlabs.fluent.models.DiskProperties;
import com.azure.resourcemanager.devtestlabs.models.StorageType;
import org.junit.jupiter.api.Assertions;

public final class DiskPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DiskProperties model =
            BinaryData
                .fromString(
                    "{\"diskType\":\"Premium\",\"diskSizeGiB\":1110569499,\"leasedByLabVmId\":\"bzydvfvfcj\",\"diskBlobName\":\"eoisrvhmgor\",\"diskUri\":\"ukiscvwmzhw\",\"storageAccountId\":\"efaxvxilc\",\"createdDate\":\"2021-01-12T00:47:11Z\",\"hostCaching\":\"hnze\",\"managedDiskId\":\"xtjjfzqlqhycav\",\"provisioningState\":\"ggxdb\",\"uniqueIdentifier\":\"smieknlra\"}")
                .toObject(DiskProperties.class);
        Assertions.assertEquals(StorageType.PREMIUM, model.diskType());
        Assertions.assertEquals(1110569499, model.diskSizeGiB());
        Assertions.assertEquals("bzydvfvfcj", model.leasedByLabVmId());
        Assertions.assertEquals("eoisrvhmgor", model.diskBlobName());
        Assertions.assertEquals("ukiscvwmzhw", model.diskUri());
        Assertions.assertEquals("efaxvxilc", model.storageAccountId());
        Assertions.assertEquals("hnze", model.hostCaching());
        Assertions.assertEquals("xtjjfzqlqhycav", model.managedDiskId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DiskProperties model =
            new DiskProperties()
                .withDiskType(StorageType.PREMIUM)
                .withDiskSizeGiB(1110569499)
                .withLeasedByLabVmId("bzydvfvfcj")
                .withDiskBlobName("eoisrvhmgor")
                .withDiskUri("ukiscvwmzhw")
                .withStorageAccountId("efaxvxilc")
                .withHostCaching("hnze")
                .withManagedDiskId("xtjjfzqlqhycav");
        model = BinaryData.fromObject(model).toObject(DiskProperties.class);
        Assertions.assertEquals(StorageType.PREMIUM, model.diskType());
        Assertions.assertEquals(1110569499, model.diskSizeGiB());
        Assertions.assertEquals("bzydvfvfcj", model.leasedByLabVmId());
        Assertions.assertEquals("eoisrvhmgor", model.diskBlobName());
        Assertions.assertEquals("ukiscvwmzhw", model.diskUri());
        Assertions.assertEquals("efaxvxilc", model.storageAccountId());
        Assertions.assertEquals("hnze", model.hostCaching());
        Assertions.assertEquals("xtjjfzqlqhycav", model.managedDiskId());
    }
}
