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

package com.azure.resourcemanager.imagebuilder.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateShellValidator;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ImageTemplateShellValidatorTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ImageTemplateShellValidator model =
            BinaryData
                .fromString(
                    "{\"type\":\"Shell\",\"scriptUri\":\"asxazjpqyegualhb\",\"sha256Checksum\":\"hejjz\",\"inline\":[\"udgwdslfho\",\"wmc\",\"npwlbjnpg\"],\"name\":\"ftadehxnltyfs\"}")
                .toObject(ImageTemplateShellValidator.class);
        Assertions.assertEquals("ftadehxnltyfs", model.name());
        Assertions.assertEquals("asxazjpqyegualhb", model.scriptUri());
        Assertions.assertEquals("hejjz", model.sha256Checksum());
        Assertions.assertEquals("udgwdslfho", model.inline().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ImageTemplateShellValidator model =
            new ImageTemplateShellValidator()
                .withName("ftadehxnltyfs")
                .withScriptUri("asxazjpqyegualhb")
                .withSha256Checksum("hejjz")
                .withInline(Arrays.asList("udgwdslfho", "wmc", "npwlbjnpg"));
        model = BinaryData.fromObject(model).toObject(ImageTemplateShellValidator.class);
        Assertions.assertEquals("ftadehxnltyfs", model.name());
        Assertions.assertEquals("asxazjpqyegualhb", model.scriptUri());
        Assertions.assertEquals("hejjz", model.sha256Checksum());
        Assertions.assertEquals("udgwdslfho", model.inline().get(0));
    }
}
