// 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.models.ComputeDataDisk;
import org.junit.jupiter.api.Assertions;

public final class ComputeDataDiskTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ComputeDataDisk model =
            BinaryData
                .fromString(
                    "{\"name\":\"hsphaivmxyas\",\"diskUri\":\"vgsgzwywakoihkn\",\"managedDiskId\":\"jblmljhlnymz\",\"diskSizeGiB\":1504701395}")
                .toObject(ComputeDataDisk.class);
        Assertions.assertEquals("hsphaivmxyas", model.name());
        Assertions.assertEquals("vgsgzwywakoihkn", model.diskUri());
        Assertions.assertEquals("jblmljhlnymz", model.managedDiskId());
        Assertions.assertEquals(1504701395, model.diskSizeGiB());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ComputeDataDisk model =
            new ComputeDataDisk()
                .withName("hsphaivmxyas")
                .withDiskUri("vgsgzwywakoihkn")
                .withManagedDiskId("jblmljhlnymz")
                .withDiskSizeGiB(1504701395);
        model = BinaryData.fromObject(model).toObject(ComputeDataDisk.class);
        Assertions.assertEquals("hsphaivmxyas", model.name());
        Assertions.assertEquals("vgsgzwywakoihkn", model.diskUri());
        Assertions.assertEquals("jblmljhlnymz", model.managedDiskId());
        Assertions.assertEquals(1504701395, model.diskSizeGiB());
    }
}
