// 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.models.GitHubRepoProperties;
import com.azure.resourcemanager.securitydevops.models.ProvisioningState;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class GitHubRepoPropertiesTests {
    @Test
    public void testDeserialize() {
        GitHubRepoProperties model =
            BinaryData
                .fromString(
                    "{\"provisioningState\":\"Failed\",\"accountId\":5381243547184167814,\"repoUrl\":\"s\",\"ownerName\":\"y\"}")
                .toObject(GitHubRepoProperties.class);
        Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState());
        Assertions.assertEquals(5381243547184167814L, model.accountId());
        Assertions.assertEquals("s", model.repoUrl());
        Assertions.assertEquals("y", model.ownerName());
    }

    @Test
    public void testSerialize() {
        GitHubRepoProperties model =
            new GitHubRepoProperties()
                .withProvisioningState(ProvisioningState.FAILED)
                .withAccountId(5381243547184167814L)
                .withRepoUrl("s")
                .withOwnerName("y");
        model = BinaryData.fromObject(model).toObject(GitHubRepoProperties.class);
        Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState());
        Assertions.assertEquals(5381243547184167814L, model.accountId());
        Assertions.assertEquals("s", model.repoUrl());
        Assertions.assertEquals("y", model.ownerName());
    }
}
