// 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.ImageTemplateShellCustomizer;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ImageTemplateShellCustomizerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ImageTemplateShellCustomizer model =
            BinaryData
                .fromString(
                    "{\"type\":\"Shell\",\"scriptUri\":\"mdectehfiqscjey\",\"sha256Checksum\":\"hezrkgq\",\"inline\":[\"refovgmkqsleyyvx\",\"qjpkcattpngjcrc\",\"zsqpjhvmdajvny\",\"ounqecano\"],\"name\":\"upfh\"}")
                .toObject(ImageTemplateShellCustomizer.class);
        Assertions.assertEquals("upfh", model.name());
        Assertions.assertEquals("mdectehfiqscjey", model.scriptUri());
        Assertions.assertEquals("hezrkgq", model.sha256Checksum());
        Assertions.assertEquals("refovgmkqsleyyvx", model.inline().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ImageTemplateShellCustomizer model =
            new ImageTemplateShellCustomizer()
                .withName("upfh")
                .withScriptUri("mdectehfiqscjey")
                .withSha256Checksum("hezrkgq")
                .withInline(Arrays.asList("refovgmkqsleyyvx", "qjpkcattpngjcrc", "zsqpjhvmdajvny", "ounqecano"));
        model = BinaryData.fromObject(model).toObject(ImageTemplateShellCustomizer.class);
        Assertions.assertEquals("upfh", model.name());
        Assertions.assertEquals("mdectehfiqscjey", model.scriptUri());
        Assertions.assertEquals("hezrkgq", model.sha256Checksum());
        Assertions.assertEquals("refovgmkqsleyyvx", model.inline().get(0));
    }
}
