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

package com.azure.resourcemanager.networkcloud.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.networkcloud.models.OsDisk;
import com.azure.resourcemanager.networkcloud.models.OsDiskCreateOption;
import com.azure.resourcemanager.networkcloud.models.OsDiskDeleteOption;
import com.azure.resourcemanager.networkcloud.models.StorageProfile;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class StorageProfileTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        StorageProfile model =
            BinaryData
                .fromString(
                    "{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":3098779210531372823},\"volumeAttachments\":[\"abrqnkkzj\",\"jb\",\"rgaehvvibrxjj\",\"toqbeitpkxztmoob\"]}")
                .toObject(StorageProfile.class);
        Assertions.assertEquals(OsDiskCreateOption.EPHEMERAL, model.osDisk().createOption());
        Assertions.assertEquals(OsDiskDeleteOption.DELETE, model.osDisk().deleteOption());
        Assertions.assertEquals(3098779210531372823L, model.osDisk().diskSizeGB());
        Assertions.assertEquals("abrqnkkzj", model.volumeAttachments().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        StorageProfile model =
            new StorageProfile()
                .withOsDisk(
                    new OsDisk()
                        .withCreateOption(OsDiskCreateOption.EPHEMERAL)
                        .withDeleteOption(OsDiskDeleteOption.DELETE)
                        .withDiskSizeGB(3098779210531372823L))
                .withVolumeAttachments(Arrays.asList("abrqnkkzj", "jb", "rgaehvvibrxjj", "toqbeitpkxztmoob"));
        model = BinaryData.fromObject(model).toObject(StorageProfile.class);
        Assertions.assertEquals(OsDiskCreateOption.EPHEMERAL, model.osDisk().createOption());
        Assertions.assertEquals(OsDiskDeleteOption.DELETE, model.osDisk().deleteOption());
        Assertions.assertEquals(3098779210531372823L, model.osDisk().diskSizeGB());
        Assertions.assertEquals("abrqnkkzj", model.volumeAttachments().get(0));
    }
}
