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

package com.azure.resourcemanager.batch.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.batch.models.CachingType;
import com.azure.resourcemanager.batch.models.DataDisk;
import com.azure.resourcemanager.batch.models.StorageAccountType;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class DataDiskTests {
    @Test
    public void testDeserialize() {
        DataDisk model =
            BinaryData
                .fromString(
                    "{\"lun\":1420775781,\"caching\":\"ReadWrite\",\"diskSizeGB\":75465955,\"storageAccountType\":\"Standard_LRS\"}")
                .toObject(DataDisk.class);
        Assertions.assertEquals(1420775781, model.lun());
        Assertions.assertEquals(CachingType.READ_WRITE, model.caching());
        Assertions.assertEquals(75465955, model.diskSizeGB());
        Assertions.assertEquals(StorageAccountType.STANDARD_LRS, model.storageAccountType());
    }

    @Test
    public void testSerialize() {
        DataDisk model =
            new DataDisk()
                .withLun(1420775781)
                .withCaching(CachingType.READ_WRITE)
                .withDiskSizeGB(75465955)
                .withStorageAccountType(StorageAccountType.STANDARD_LRS);
        model = BinaryData.fromObject(model).toObject(DataDisk.class);
        Assertions.assertEquals(1420775781, model.lun());
        Assertions.assertEquals(CachingType.READ_WRITE, model.caching());
        Assertions.assertEquals(75465955, model.diskSizeGB());
        Assertions.assertEquals(StorageAccountType.STANDARD_LRS, model.storageAccountType());
    }
}
