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

package com.azure.resourcemanager.securitydevops.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.securitydevops.fluent.models.GitHubRepoInner;
import com.azure.resourcemanager.securitydevops.models.GitHubRepoProperties;
import com.azure.resourcemanager.securitydevops.models.ProvisioningState;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class GitHubRepoInnerTests {
    @Test
    public void testDeserialize() {
        GitHubRepoInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"provisioningState\":\"Canceled\",\"accountId\":5545667230906831510,\"repoUrl\":\"nbdxk\",\"ownerName\":\"xo\"},\"id\":\"jionpimexgstxgc\",\"name\":\"odgmaajrmvdjwz\",\"type\":\"lovmclwhijcoe\"}")
                .toObject(GitHubRepoInner.class);
        Assertions.assertEquals(ProvisioningState.CANCELED, model.properties().provisioningState());
        Assertions.assertEquals(5545667230906831510L, model.properties().accountId());
        Assertions.assertEquals("nbdxk", model.properties().repoUrl());
        Assertions.assertEquals("xo", model.properties().ownerName());
    }

    @Test
    public void testSerialize() {
        GitHubRepoInner model =
            new GitHubRepoInner()
                .withProperties(
                    new GitHubRepoProperties()
                        .withProvisioningState(ProvisioningState.CANCELED)
                        .withAccountId(5545667230906831510L)
                        .withRepoUrl("nbdxk")
                        .withOwnerName("xo"));
        model = BinaryData.fromObject(model).toObject(GitHubRepoInner.class);
        Assertions.assertEquals(ProvisioningState.CANCELED, model.properties().provisioningState());
        Assertions.assertEquals(5545667230906831510L, model.properties().accountId());
        Assertions.assertEquals("nbdxk", model.properties().repoUrl());
        Assertions.assertEquals("xo", model.properties().ownerName());
    }
}
