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

package com.azure.resourcemanager.devtestlabs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devtestlabs.models.FileUploadOptions;
import com.azure.resourcemanager.devtestlabs.models.GenerateArmTemplateRequest;
import com.azure.resourcemanager.devtestlabs.models.ParameterInfo;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class GenerateArmTemplateRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        GenerateArmTemplateRequest model =
            BinaryData
                .fromString(
                    "{\"virtualMachineName\":\"napnyiropuhpigv\",\"parameters\":[{\"name\":\"gqgitxmedjvcsl\",\"value\":\"qwwncw\"},{\"name\":\"hxg\",\"value\":\"rmgucnap\"},{\"name\":\"eoellwptfdygp\",\"value\":\"b\"},{\"name\":\"ceopzfqrhhuaopp\",\"value\":\"qeqxo\"}],\"location\":\"dahzxctobg\",\"fileUploadOptions\":\"None\"}")
                .toObject(GenerateArmTemplateRequest.class);
        Assertions.assertEquals("napnyiropuhpigv", model.virtualMachineName());
        Assertions.assertEquals("gqgitxmedjvcsl", model.parameters().get(0).name());
        Assertions.assertEquals("qwwncw", model.parameters().get(0).value());
        Assertions.assertEquals("dahzxctobg", model.location());
        Assertions.assertEquals(FileUploadOptions.NONE, model.fileUploadOptions());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        GenerateArmTemplateRequest model =
            new GenerateArmTemplateRequest()
                .withVirtualMachineName("napnyiropuhpigv")
                .withParameters(
                    Arrays
                        .asList(
                            new ParameterInfo().withName("gqgitxmedjvcsl").withValue("qwwncw"),
                            new ParameterInfo().withName("hxg").withValue("rmgucnap"),
                            new ParameterInfo().withName("eoellwptfdygp").withValue("b"),
                            new ParameterInfo().withName("ceopzfqrhhuaopp").withValue("qeqxo")))
                .withLocation("dahzxctobg")
                .withFileUploadOptions(FileUploadOptions.NONE);
        model = BinaryData.fromObject(model).toObject(GenerateArmTemplateRequest.class);
        Assertions.assertEquals("napnyiropuhpigv", model.virtualMachineName());
        Assertions.assertEquals("gqgitxmedjvcsl", model.parameters().get(0).name());
        Assertions.assertEquals("qwwncw", model.parameters().get(0).value());
        Assertions.assertEquals("dahzxctobg", model.location());
        Assertions.assertEquals(FileUploadOptions.NONE, model.fileUploadOptions());
    }
}
