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

package com.azure.resourcemanager.baremetalinfrastructure.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.baremetalinfrastructure.models.Disk;
import com.azure.resourcemanager.baremetalinfrastructure.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(
                    "{\"nfsIpAddress\":\"eho\",\"osDisks\":[{\"name\":\"huxinpmqnj\",\"diskSizeGB\":956745772,\"lun\":288433409},{\"name\":\"sprozvcput\",\"diskSizeGB\":1721756309,\"lun\":1903590590}]}")
                .toObject(StorageProfile.class);
        Assertions.assertEquals("huxinpmqnj", model.osDisks().get(0).name());
        Assertions.assertEquals(956745772, model.osDisks().get(0).diskSizeGB());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        StorageProfile model =
            new StorageProfile()
                .withOsDisks(
                    Arrays
                        .asList(
                            new Disk().withName("huxinpmqnj").withDiskSizeGB(956745772),
                            new Disk().withName("sprozvcput").withDiskSizeGB(1721756309)));
        model = BinaryData.fromObject(model).toObject(StorageProfile.class);
        Assertions.assertEquals("huxinpmqnj", model.osDisks().get(0).name());
        Assertions.assertEquals(956745772, model.osDisks().get(0).diskSizeGB());
    }
}
