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

package com.azure.resourcemanager.mediaservices.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mediaservices.models.ArmStreamingEndpointCapacity;
import com.azure.resourcemanager.mediaservices.models.ArmStreamingEndpointSku;
import com.azure.resourcemanager.mediaservices.models.ArmStreamingEndpointSkuInfo;
import org.junit.jupiter.api.Assertions;

public final class ArmStreamingEndpointSkuInfoTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ArmStreamingEndpointSkuInfo model =
            BinaryData
                .fromString(
                    "{\"resourceType\":\"ywrckp\",\"capacity\":{\"scaleType\":\"yhpluodpvruudlgz\",\"default\":1325865791,\"minimum\":1621588970,\"maximum\":777690092},\"sku\":{\"name\":\"tstvdxeclzedq\"}}")
                .toObject(ArmStreamingEndpointSkuInfo.class);
        Assertions.assertEquals("ywrckp", model.resourceType());
        Assertions.assertEquals(1325865791, model.capacity().defaultProperty());
        Assertions.assertEquals(1621588970, model.capacity().minimum());
        Assertions.assertEquals(777690092, model.capacity().maximum());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ArmStreamingEndpointSkuInfo model =
            new ArmStreamingEndpointSkuInfo()
                .withResourceType("ywrckp")
                .withCapacity(
                    new ArmStreamingEndpointCapacity()
                        .withDefaultProperty(1325865791)
                        .withMinimum(1621588970)
                        .withMaximum(777690092))
                .withSku(new ArmStreamingEndpointSku());
        model = BinaryData.fromObject(model).toObject(ArmStreamingEndpointSkuInfo.class);
        Assertions.assertEquals("ywrckp", model.resourceType());
        Assertions.assertEquals(1325865791, model.capacity().defaultProperty());
        Assertions.assertEquals(1621588970, model.capacity().minimum());
        Assertions.assertEquals(777690092, model.capacity().maximum());
    }
}
