// 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.AzureDevOpsConnectorStats;
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 AzureDevOpsConnectorStatsTests {
    @Test
    public void testDeserialize() {
        AzureDevOpsConnectorStats model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"provisioningState\":\"Canceled\",\"orgsCount\":7897278653566127978,\"projectsCount\":5452111836189203218,\"reposCount\":3087976590796502634},\"id\":\"dgbb\",\"name\":\"f\",\"type\":\"dgmb\"}")
                .toObject(AzureDevOpsConnectorStats.class);
        Assertions.assertEquals(ProvisioningState.CANCELED, model.properties().provisioningState());
        Assertions.assertEquals(7897278653566127978L, model.properties().orgsCount());
        Assertions.assertEquals(5452111836189203218L, model.properties().projectsCount());
        Assertions.assertEquals(3087976590796502634L, model.properties().reposCount());
    }

    @Test
    public void testSerialize() {
        AzureDevOpsConnectorStats model =
            new AzureDevOpsConnectorStats()
                .withProperties(
                    new AzureDevOpsConnectorStatsProperties()
                        .withProvisioningState(ProvisioningState.CANCELED)
                        .withOrgsCount(7897278653566127978L)
                        .withProjectsCount(5452111836189203218L)
                        .withReposCount(3087976590796502634L));
        model = BinaryData.fromObject(model).toObject(AzureDevOpsConnectorStats.class);
        Assertions.assertEquals(ProvisioningState.CANCELED, model.properties().provisioningState());
        Assertions.assertEquals(7897278653566127978L, model.properties().orgsCount());
        Assertions.assertEquals(5452111836189203218L, model.properties().projectsCount());
        Assertions.assertEquals(3087976590796502634L, model.properties().reposCount());
    }
}
