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

public final class GitHubConnectorStatsPropertiesTests {
    @Test
    public void testDeserialize() {
        GitHubConnectorStatsProperties model =
            BinaryData
                .fromString(
                    "{\"provisioningState\":\"Canceled\",\"ownersCount\":87946417642997689,\"reposCount\":232356034449895741}")
                .toObject(GitHubConnectorStatsProperties.class);
        Assertions.assertEquals(ProvisioningState.CANCELED, model.provisioningState());
        Assertions.assertEquals(87946417642997689L, model.ownersCount());
        Assertions.assertEquals(232356034449895741L, model.reposCount());
    }

    @Test
    public void testSerialize() {
        GitHubConnectorStatsProperties model =
            new GitHubConnectorStatsProperties()
                .withProvisioningState(ProvisioningState.CANCELED)
                .withOwnersCount(87946417642997689L)
                .withReposCount(232356034449895741L);
        model = BinaryData.fromObject(model).toObject(GitHubConnectorStatsProperties.class);
        Assertions.assertEquals(ProvisioningState.CANCELED, model.provisioningState());
        Assertions.assertEquals(87946417642997689L, model.ownersCount());
        Assertions.assertEquals(232356034449895741L, model.reposCount());
    }
}
