// 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.DiffDiskPlacement;
import com.azure.resourcemanager.batch.models.DiffDiskSettings;
import com.azure.resourcemanager.batch.models.OSDisk;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class OSDiskTests {
    @Test
    public void testDeserialize() {
        OSDisk model =
            BinaryData.fromString("{\"ephemeralOSDiskSettings\":{\"placement\":\"CacheDisk\"}}").toObject(OSDisk.class);
        Assertions.assertEquals(DiffDiskPlacement.CACHE_DISK, model.ephemeralOSDiskSettings().placement());
    }

    @Test
    public void testSerialize() {
        OSDisk model =
            new OSDisk()
                .withEphemeralOSDiskSettings(new DiffDiskSettings().withPlacement(DiffDiskPlacement.CACHE_DISK));
        model = BinaryData.fromObject(model).toObject(OSDisk.class);
        Assertions.assertEquals(DiffDiskPlacement.CACHE_DISK, model.ephemeralOSDiskSettings().placement());
    }
}
