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

package com.azure.resourcemanager.vmwarecloudsimple.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.vmwarecloudsimple.models.AggregationType;
import com.azure.resourcemanager.vmwarecloudsimple.models.AvailableOperationDisplayPropertyServiceSpecificationMetricsItem;
import org.junit.jupiter.api.Assertions;

public final class AvailableOperationDisplayPropertyServiceSpecificationMetricsItemTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AvailableOperationDisplayPropertyServiceSpecificationMetricsItem model =
            BinaryData
                .fromString(
                    "{\"aggregationType\":\"Total\",\"displayDescription\":\"uxinpmqnjaq\",\"displayName\":\"ixjsprozvcputeg\",\"name\":\"vwmf\",\"unit\":\"atscmd\"}")
                .toObject(AvailableOperationDisplayPropertyServiceSpecificationMetricsItem.class);
        Assertions.assertEquals(AggregationType.TOTAL, model.aggregationType());
        Assertions.assertEquals("uxinpmqnjaq", model.displayDescription());
        Assertions.assertEquals("ixjsprozvcputeg", model.displayName());
        Assertions.assertEquals("vwmf", model.name());
        Assertions.assertEquals("atscmd", model.unit());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AvailableOperationDisplayPropertyServiceSpecificationMetricsItem model =
            new AvailableOperationDisplayPropertyServiceSpecificationMetricsItem()
                .withAggregationType(AggregationType.TOTAL)
                .withDisplayDescription("uxinpmqnjaq")
                .withDisplayName("ixjsprozvcputeg")
                .withName("vwmf")
                .withUnit("atscmd");
        model =
            BinaryData
                .fromObject(model)
                .toObject(AvailableOperationDisplayPropertyServiceSpecificationMetricsItem.class);
        Assertions.assertEquals(AggregationType.TOTAL, model.aggregationType());
        Assertions.assertEquals("uxinpmqnjaq", model.displayDescription());
        Assertions.assertEquals("ixjsprozvcputeg", model.displayName());
        Assertions.assertEquals("vwmf", model.name());
        Assertions.assertEquals("atscmd", model.unit());
    }
}
