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

package com.azure.resourcemanager.recoveryservices.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner;
import com.azure.resourcemanager.recoveryservices.models.JobsSummary;
import com.azure.resourcemanager.recoveryservices.models.MonitoringSummary;
import org.junit.jupiter.api.Assertions;

public final class ReplicationUsageInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ReplicationUsageInner model =
            BinaryData
                .fromString(
                    "{\"monitoringSummary\":{\"unHealthyVmCount\":1532132699,\"unHealthyProviderCount\":1672849191,\"eventsCount\":961101058,\"deprecatedProviderCount\":516100581,\"supportedProviderCount\":492523913,\"unsupportedProviderCount\":1080662266},\"jobsSummary\":{\"failedJobs\":1270858426,\"suspendedJobs\":727938504,\"inProgressJobs\":1303287981},\"protectedItemCount\":853033280,\"recoveryPlanCount\":1452273822,\"registeredServersCount\":970292518,\"recoveryServicesProviderAuthType\":1524084754}")
                .toObject(ReplicationUsageInner.class);
        Assertions.assertEquals(1532132699, model.monitoringSummary().unHealthyVmCount());
        Assertions.assertEquals(1672849191, model.monitoringSummary().unHealthyProviderCount());
        Assertions.assertEquals(961101058, model.monitoringSummary().eventsCount());
        Assertions.assertEquals(516100581, model.monitoringSummary().deprecatedProviderCount());
        Assertions.assertEquals(492523913, model.monitoringSummary().supportedProviderCount());
        Assertions.assertEquals(1080662266, model.monitoringSummary().unsupportedProviderCount());
        Assertions.assertEquals(1270858426, model.jobsSummary().failedJobs());
        Assertions.assertEquals(727938504, model.jobsSummary().suspendedJobs());
        Assertions.assertEquals(1303287981, model.jobsSummary().inProgressJobs());
        Assertions.assertEquals(853033280, model.protectedItemCount());
        Assertions.assertEquals(1452273822, model.recoveryPlanCount());
        Assertions.assertEquals(970292518, model.registeredServersCount());
        Assertions.assertEquals(1524084754, model.recoveryServicesProviderAuthType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ReplicationUsageInner model =
            new ReplicationUsageInner()
                .withMonitoringSummary(
                    new MonitoringSummary()
                        .withUnHealthyVmCount(1532132699)
                        .withUnHealthyProviderCount(1672849191)
                        .withEventsCount(961101058)
                        .withDeprecatedProviderCount(516100581)
                        .withSupportedProviderCount(492523913)
                        .withUnsupportedProviderCount(1080662266))
                .withJobsSummary(
                    new JobsSummary()
                        .withFailedJobs(1270858426)
                        .withSuspendedJobs(727938504)
                        .withInProgressJobs(1303287981))
                .withProtectedItemCount(853033280)
                .withRecoveryPlanCount(1452273822)
                .withRegisteredServersCount(970292518)
                .withRecoveryServicesProviderAuthType(1524084754);
        model = BinaryData.fromObject(model).toObject(ReplicationUsageInner.class);
        Assertions.assertEquals(1532132699, model.monitoringSummary().unHealthyVmCount());
        Assertions.assertEquals(1672849191, model.monitoringSummary().unHealthyProviderCount());
        Assertions.assertEquals(961101058, model.monitoringSummary().eventsCount());
        Assertions.assertEquals(516100581, model.monitoringSummary().deprecatedProviderCount());
        Assertions.assertEquals(492523913, model.monitoringSummary().supportedProviderCount());
        Assertions.assertEquals(1080662266, model.monitoringSummary().unsupportedProviderCount());
        Assertions.assertEquals(1270858426, model.jobsSummary().failedJobs());
        Assertions.assertEquals(727938504, model.jobsSummary().suspendedJobs());
        Assertions.assertEquals(1303287981, model.jobsSummary().inProgressJobs());
        Assertions.assertEquals(853033280, model.protectedItemCount());
        Assertions.assertEquals(1452273822, model.recoveryPlanCount());
        Assertions.assertEquals(970292518, model.registeredServersCount());
        Assertions.assertEquals(1524084754, model.recoveryServicesProviderAuthType());
    }
}
