// 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.StorageApplianceCommandSpecification;
import com.azure.resourcemanager.networkcloud.models.StorageApplianceRunReadCommandsParameters;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class StorageApplianceRunReadCommandsParametersTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        StorageApplianceRunReadCommandsParameters model =
            BinaryData
                .fromString(
                    "{\"commands\":[{\"arguments\":[\"xjbaqehgpdohzjq\"],\"command\":\"tu\"},{\"arguments\":[\"gebx\",\"cnwfepbnwgfmxjg\",\"g\",\"jbgdlfgtdysnaquf\"],\"command\":\"qbctqha\"}],\"limitTimeSeconds\":1033293185203169691}")
                .toObject(StorageApplianceRunReadCommandsParameters.class);
        Assertions.assertEquals("xjbaqehgpdohzjq", model.commands().get(0).arguments().get(0));
        Assertions.assertEquals("tu", model.commands().get(0).command());
        Assertions.assertEquals(1033293185203169691L, model.limitTimeSeconds());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        StorageApplianceRunReadCommandsParameters model =
            new StorageApplianceRunReadCommandsParameters()
                .withCommands(
                    Arrays
                        .asList(
                            new StorageApplianceCommandSpecification()
                                .withArguments(Arrays.asList("xjbaqehgpdohzjq"))
                                .withCommand("tu"),
                            new StorageApplianceCommandSpecification()
                                .withArguments(Arrays.asList("gebx", "cnwfepbnwgfmxjg", "g", "jbgdlfgtdysnaquf"))
                                .withCommand("qbctqha")))
                .withLimitTimeSeconds(1033293185203169691L);
        model = BinaryData.fromObject(model).toObject(StorageApplianceRunReadCommandsParameters.class);
        Assertions.assertEquals("xjbaqehgpdohzjq", model.commands().get(0).arguments().get(0));
        Assertions.assertEquals("tu", model.commands().get(0).command());
        Assertions.assertEquals(1033293185203169691L, model.limitTimeSeconds());
    }
}
