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

public final class AzureDevOpsConnectorStatsPropertiesTests {
    @Test
    public void testDeserialize() {
        AzureDevOpsConnectorStatsProperties model =
            BinaryData
                .fromString(
                    "{\"provisioningState\":\"Canceled\",\"orgsCount\":3878609364909572691,\"projectsCount\":313278106119438402,\"reposCount\":7863810899973495328}")
                .toObject(AzureDevOpsConnectorStatsProperties.class);
        Assertions.assertEquals(ProvisioningState.CANCELED, model.provisioningState());
        Assertions.assertEquals(3878609364909572691L, model.orgsCount());
        Assertions.assertEquals(313278106119438402L, model.projectsCount());
        Assertions.assertEquals(7863810899973495328L, model.reposCount());
    }

    @Test
    public void testSerialize() {
        AzureDevOpsConnectorStatsProperties model =
            new AzureDevOpsConnectorStatsProperties()
                .withProvisioningState(ProvisioningState.CANCELED)
                .withOrgsCount(3878609364909572691L)
                .withProjectsCount(313278106119438402L)
                .withReposCount(7863810899973495328L);
        model = BinaryData.fromObject(model).toObject(AzureDevOpsConnectorStatsProperties.class);
        Assertions.assertEquals(ProvisioningState.CANCELED, model.provisioningState());
        Assertions.assertEquals(3878609364909572691L, model.orgsCount());
        Assertions.assertEquals(313278106119438402L, model.projectsCount());
        Assertions.assertEquals(7863810899973495328L, model.reposCount());
    }
}
