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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.models.AzureCapacity;
import com.azure.resourcemanager.synapse.models.AzureScaleType;
import org.junit.jupiter.api.Assertions;

public final class AzureCapacityTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AzureCapacity model =
            BinaryData
                .fromString(
                    "{\"scaleType\":\"automatic\",\"minimum\":1248191689,\"maximum\":1441731136,\"default\":576028683}")
                .toObject(AzureCapacity.class);
        Assertions.assertEquals(AzureScaleType.AUTOMATIC, model.scaleType());
        Assertions.assertEquals(1248191689, model.minimum());
        Assertions.assertEquals(1441731136, model.maximum());
        Assertions.assertEquals(576028683, model.defaultProperty());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AzureCapacity model =
            new AzureCapacity()
                .withScaleType(AzureScaleType.AUTOMATIC)
                .withMinimum(1248191689)
                .withMaximum(1441731136)
                .withDefaultProperty(576028683);
        model = BinaryData.fromObject(model).toObject(AzureCapacity.class);
        Assertions.assertEquals(AzureScaleType.AUTOMATIC, model.scaleType());
        Assertions.assertEquals(1248191689, model.minimum());
        Assertions.assertEquals(1441731136, model.maximum());
        Assertions.assertEquals(576028683, model.defaultProperty());
    }
}
