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

package com.azure.resourcemanager.iothub.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.iothub.fluent.models.IotHubSkuDescriptionInner;
import com.azure.resourcemanager.iothub.models.IotHubCapacity;
import com.azure.resourcemanager.iothub.models.IotHubSku;
import com.azure.resourcemanager.iothub.models.IotHubSkuInfo;
import org.junit.jupiter.api.Assertions;

public final class IotHubSkuDescriptionInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IotHubSkuDescriptionInner model =
            BinaryData
                .fromString(
                    "{\"resourceType\":\"srtslhspkdeem\",\"sku\":{\"name\":\"S3\",\"tier\":\"Basic\",\"capacity\":1461011233299690621},\"capacity\":{\"minimum\":1611861407793999607,\"maximum\":5342331061504753909,\"default\":2936969663422181948,\"scaleType\":\"Automatic\"}}")
                .toObject(IotHubSkuDescriptionInner.class);
        Assertions.assertEquals(IotHubSku.S3, model.sku().name());
        Assertions.assertEquals(1461011233299690621L, model.sku().capacity());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IotHubSkuDescriptionInner model =
            new IotHubSkuDescriptionInner()
                .withSku(new IotHubSkuInfo().withName(IotHubSku.S3).withCapacity(1461011233299690621L))
                .withCapacity(new IotHubCapacity());
        model = BinaryData.fromObject(model).toObject(IotHubSkuDescriptionInner.class);
        Assertions.assertEquals(IotHubSku.S3, model.sku().name());
        Assertions.assertEquals(1461011233299690621L, model.sku().capacity());
    }
}
