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

public final class BareMetalMachineRunReadCommandsParametersTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        BareMetalMachineRunReadCommandsParameters model =
            BinaryData
                .fromString(
                    "{\"commands\":[{\"arguments\":[\"hhvjhh\",\"akz\",\"bbjjidjksyxk\"],\"command\":\"xvxevblbjednljla\"},{\"arguments\":[\"aulx\",\"nsmjbnkppxynen\",\"svxeizzgwklnsr\"],\"command\":\"ffeycx\"},{\"arguments\":[\"piymerteea\",\"mx\",\"iekkkzddrtkgdojb\"],\"command\":\"xv\"}],\"limitTimeSeconds\":303327260761613743}")
                .toObject(BareMetalMachineRunReadCommandsParameters.class);
        Assertions.assertEquals("hhvjhh", model.commands().get(0).arguments().get(0));
        Assertions.assertEquals("xvxevblbjednljla", model.commands().get(0).command());
        Assertions.assertEquals(303327260761613743L, model.limitTimeSeconds());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        BareMetalMachineRunReadCommandsParameters model =
            new BareMetalMachineRunReadCommandsParameters()
                .withCommands(
                    Arrays
                        .asList(
                            new BareMetalMachineCommandSpecification()
                                .withArguments(Arrays.asList("hhvjhh", "akz", "bbjjidjksyxk"))
                                .withCommand("xvxevblbjednljla"),
                            new BareMetalMachineCommandSpecification()
                                .withArguments(Arrays.asList("aulx", "nsmjbnkppxynen", "svxeizzgwklnsr"))
                                .withCommand("ffeycx"),
                            new BareMetalMachineCommandSpecification()
                                .withArguments(Arrays.asList("piymerteea", "mx", "iekkkzddrtkgdojb"))
                                .withCommand("xv")))
                .withLimitTimeSeconds(303327260761613743L);
        model = BinaryData.fromObject(model).toObject(BareMetalMachineRunReadCommandsParameters.class);
        Assertions.assertEquals("hhvjhh", model.commands().get(0).arguments().get(0));
        Assertions.assertEquals("xvxevblbjednljla", model.commands().get(0).command());
        Assertions.assertEquals(303327260761613743L, model.limitTimeSeconds());
    }
}
