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

package com.azure.resourcemanager.appcontainers.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.appcontainers.fluent.models.SourceControlInner;
import com.azure.resourcemanager.appcontainers.models.GithubActionConfiguration;
import org.junit.jupiter.api.Assertions;

public final class SourceControlInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SourceControlInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"operationState\":\"Failed\",\"repoUrl\":\"oj\",\"branch\":\"giflrzpasccbiu\",\"githubActionConfiguration\":{\"contextPath\":\"yjdfqwmky\",\"image\":\"ufdvruz\",\"publishType\":\"zojhpctfnmd\",\"os\":\"tngfdgugeyzihgr\",\"runtimeStack\":\"ui\",\"runtimeVersion\":\"bsnmfpph\"}},\"id\":\"eevy\",\"name\":\"yhsgz\",\"type\":\"czbgomfgbeg\"}")
                .toObject(SourceControlInner.class);
        Assertions.assertEquals("oj", model.repoUrl());
        Assertions.assertEquals("giflrzpasccbiu", model.branch());
        Assertions.assertEquals("yjdfqwmky", model.githubActionConfiguration().contextPath());
        Assertions.assertEquals("ufdvruz", model.githubActionConfiguration().image());
        Assertions.assertEquals("zojhpctfnmd", model.githubActionConfiguration().publishType());
        Assertions.assertEquals("tngfdgugeyzihgr", model.githubActionConfiguration().os());
        Assertions.assertEquals("ui", model.githubActionConfiguration().runtimeStack());
        Assertions.assertEquals("bsnmfpph", model.githubActionConfiguration().runtimeVersion());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SourceControlInner model =
            new SourceControlInner()
                .withRepoUrl("oj")
                .withBranch("giflrzpasccbiu")
                .withGithubActionConfiguration(
                    new GithubActionConfiguration()
                        .withContextPath("yjdfqwmky")
                        .withImage("ufdvruz")
                        .withPublishType("zojhpctfnmd")
                        .withOs("tngfdgugeyzihgr")
                        .withRuntimeStack("ui")
                        .withRuntimeVersion("bsnmfpph"));
        model = BinaryData.fromObject(model).toObject(SourceControlInner.class);
        Assertions.assertEquals("oj", model.repoUrl());
        Assertions.assertEquals("giflrzpasccbiu", model.branch());
        Assertions.assertEquals("yjdfqwmky", model.githubActionConfiguration().contextPath());
        Assertions.assertEquals("ufdvruz", model.githubActionConfiguration().image());
        Assertions.assertEquals("zojhpctfnmd", model.githubActionConfiguration().publishType());
        Assertions.assertEquals("tngfdgugeyzihgr", model.githubActionConfiguration().os());
        Assertions.assertEquals("ui", model.githubActionConfiguration().runtimeStack());
        Assertions.assertEquals("bsnmfpph", model.githubActionConfiguration().runtimeVersion());
    }
}
