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

package com.azure.resourcemanager.vmwarecloudsimple.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.vmwarecloudsimple.models.DiskIndependenceMode;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualDisk;
import org.junit.jupiter.api.Assertions;

public final class VirtualDiskTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VirtualDisk model =
            BinaryData
                .fromString(
                    "{\"controllerId\":\"fbtkuwhhmhyk\",\"independenceMode\":\"persistent\",\"totalSize\":1183832331,\"virtualDiskId\":\"afnn\",\"virtualDiskName\":\"pichkoymkcdy\"}")
                .toObject(VirtualDisk.class);
        Assertions.assertEquals("fbtkuwhhmhyk", model.controllerId());
        Assertions.assertEquals(DiskIndependenceMode.PERSISTENT, model.independenceMode());
        Assertions.assertEquals(1183832331, model.totalSize());
        Assertions.assertEquals("afnn", model.virtualDiskId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VirtualDisk model =
            new VirtualDisk()
                .withControllerId("fbtkuwhhmhyk")
                .withIndependenceMode(DiskIndependenceMode.PERSISTENT)
                .withTotalSize(1183832331)
                .withVirtualDiskId("afnn");
        model = BinaryData.fromObject(model).toObject(VirtualDisk.class);
        Assertions.assertEquals("fbtkuwhhmhyk", model.controllerId());
        Assertions.assertEquals(DiskIndependenceMode.PERSISTENT, model.independenceMode());
        Assertions.assertEquals(1183832331, model.totalSize());
        Assertions.assertEquals("afnn", model.virtualDiskId());
    }
}
