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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.Caching;
import com.azure.resourcemanager.machinelearning.models.ComputeInstanceDataDisk;
import com.azure.resourcemanager.machinelearning.models.StorageAccountType;
import org.junit.jupiter.api.Assertions;

public final class ComputeInstanceDataDiskTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ComputeInstanceDataDisk model =
            BinaryData
                .fromString(
                    "{\"caching\":\"ReadWrite\",\"diskSizeGB\":264674589,\"lun\":753182470,\"storageAccountType\":\"Premium_LRS\"}")
                .toObject(ComputeInstanceDataDisk.class);
        Assertions.assertEquals(Caching.READ_WRITE, model.caching());
        Assertions.assertEquals(264674589, model.diskSizeGB());
        Assertions.assertEquals(753182470, model.lun());
        Assertions.assertEquals(StorageAccountType.PREMIUM_LRS, model.storageAccountType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ComputeInstanceDataDisk model =
            new ComputeInstanceDataDisk()
                .withCaching(Caching.READ_WRITE)
                .withDiskSizeGB(264674589)
                .withLun(753182470)
                .withStorageAccountType(StorageAccountType.PREMIUM_LRS);
        model = BinaryData.fromObject(model).toObject(ComputeInstanceDataDisk.class);
        Assertions.assertEquals(Caching.READ_WRITE, model.caching());
        Assertions.assertEquals(264674589, model.diskSizeGB());
        Assertions.assertEquals(753182470, model.lun());
        Assertions.assertEquals(StorageAccountType.PREMIUM_LRS, model.storageAccountType());
    }
}
