// 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.fluent.models.StreamingEndpointSkuInfoListResultInner;
import com.azure.resourcemanager.mediaservices.models.ArmStreamingEndpointCapacity;
import com.azure.resourcemanager.mediaservices.models.ArmStreamingEndpointSku;
import com.azure.resourcemanager.mediaservices.models.ArmStreamingEndpointSkuInfo;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class StreamingEndpointSkuInfoListResultInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        StreamingEndpointSkuInfoListResultInner model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"resourceType\":\"srhnjivo\",\"capacity\":{\"scaleType\":\"novqfzge\",\"default\":1068336147,\"minimum\":566007686,\"maximum\":311257977},\"sku\":{\"name\":\"tduceamt\"}},{\"resourceType\":\"zuo\",\"capacity\":{\"scaleType\":\"wcw\",\"default\":303130680,\"minimum\":173191465,\"maximum\":2110240419},\"sku\":{\"name\":\"mojmsvpkjprvkw\"}},{\"resourceType\":\"zqljyxgtczh\",\"capacity\":{\"scaleType\":\"bsdshmkxmaehvbbx\",\"default\":870827030,\"minimum\":874326134,\"maximum\":1041302406},\"sku\":{\"name\":\"tbaxk\"}}]}")
                .toObject(StreamingEndpointSkuInfoListResultInner.class);
        Assertions.assertEquals("srhnjivo", model.value().get(0).resourceType());
        Assertions.assertEquals(1068336147, model.value().get(0).capacity().defaultProperty());
        Assertions.assertEquals(566007686, model.value().get(0).capacity().minimum());
        Assertions.assertEquals(311257977, model.value().get(0).capacity().maximum());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        StreamingEndpointSkuInfoListResultInner model =
            new StreamingEndpointSkuInfoListResultInner()
                .withValue(
                    Arrays
                        .asList(
                            new ArmStreamingEndpointSkuInfo()
                                .withResourceType("srhnjivo")
                                .withCapacity(
                                    new ArmStreamingEndpointCapacity()
                                        .withDefaultProperty(1068336147)
                                        .withMinimum(566007686)
                                        .withMaximum(311257977))
                                .withSku(new ArmStreamingEndpointSku()),
                            new ArmStreamingEndpointSkuInfo()
                                .withResourceType("zuo")
                                .withCapacity(
                                    new ArmStreamingEndpointCapacity()
                                        .withDefaultProperty(303130680)
                                        .withMinimum(173191465)
                                        .withMaximum(2110240419))
                                .withSku(new ArmStreamingEndpointSku()),
                            new ArmStreamingEndpointSkuInfo()
                                .withResourceType("zqljyxgtczh")
                                .withCapacity(
                                    new ArmStreamingEndpointCapacity()
                                        .withDefaultProperty(870827030)
                                        .withMinimum(874326134)
                                        .withMaximum(1041302406))
                                .withSku(new ArmStreamingEndpointSku())));
        model = BinaryData.fromObject(model).toObject(StreamingEndpointSkuInfoListResultInner.class);
        Assertions.assertEquals("srhnjivo", model.value().get(0).resourceType());
        Assertions.assertEquals(1068336147, model.value().get(0).capacity().defaultProperty());
        Assertions.assertEquals(566007686, model.value().get(0).capacity().minimum());
        Assertions.assertEquals(311257977, model.value().get(0).capacity().maximum());
    }
}
