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

package com.azure.resourcemanager.hybridnetwork.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hybridnetwork.models.OperatingSystemTypes;
import com.azure.resourcemanager.hybridnetwork.models.OsDisk;
import com.azure.resourcemanager.hybridnetwork.models.VirtualHardDisk;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class OsDiskTests {
    @Test
    public void testDeserialize() {
        OsDisk model =
            BinaryData
                .fromString(
                    "{\"osType\":\"Linux\",\"name\":\"adehxnltyfsopp\",\"vhd\":{\"uri\":\"esnzwde\"},\"diskSizeGB\":600821678}")
                .toObject(OsDisk.class);
        Assertions.assertEquals(OperatingSystemTypes.LINUX, model.osType());
        Assertions.assertEquals("adehxnltyfsopp", model.name());
        Assertions.assertEquals("esnzwde", model.vhd().uri());
        Assertions.assertEquals(600821678, model.diskSizeGB());
    }

    @Test
    public void testSerialize() {
        OsDisk model =
            new OsDisk()
                .withOsType(OperatingSystemTypes.LINUX)
                .withName("adehxnltyfsopp")
                .withVhd(new VirtualHardDisk().withUri("esnzwde"))
                .withDiskSizeGB(600821678);
        model = BinaryData.fromObject(model).toObject(OsDisk.class);
        Assertions.assertEquals(OperatingSystemTypes.LINUX, model.osType());
        Assertions.assertEquals("adehxnltyfsopp", model.name());
        Assertions.assertEquals("esnzwde", model.vhd().uri());
        Assertions.assertEquals(600821678, model.diskSizeGB());
    }
}
