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

package com.azure.resourcemanager.cognitiveservices.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.cognitiveservices.models.AccountSku;
import com.azure.resourcemanager.cognitiveservices.models.Sku;
import com.azure.resourcemanager.cognitiveservices.models.SkuTier;
import org.junit.jupiter.api.Assertions;

public final class AccountSkuTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AccountSku model =
            BinaryData
                .fromString(
                    "{\"resourceType\":\"jampmngnzscxaqw\",\"sku\":{\"name\":\"chcbonqvpkvlrxnj\",\"tier\":\"Basic\",\"size\":\"ipheoflokeyyien\",\"family\":\"dlwtgrhpdj\",\"capacity\":523400535}}")
                .toObject(AccountSku.class);
        Assertions.assertEquals("jampmngnzscxaqw", model.resourceType());
        Assertions.assertEquals("chcbonqvpkvlrxnj", model.sku().name());
        Assertions.assertEquals(SkuTier.BASIC, model.sku().tier());
        Assertions.assertEquals("ipheoflokeyyien", model.sku().size());
        Assertions.assertEquals("dlwtgrhpdj", model.sku().family());
        Assertions.assertEquals(523400535, model.sku().capacity());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AccountSku model =
            new AccountSku()
                .withResourceType("jampmngnzscxaqw")
                .withSku(
                    new Sku()
                        .withName("chcbonqvpkvlrxnj")
                        .withTier(SkuTier.BASIC)
                        .withSize("ipheoflokeyyien")
                        .withFamily("dlwtgrhpdj")
                        .withCapacity(523400535));
        model = BinaryData.fromObject(model).toObject(AccountSku.class);
        Assertions.assertEquals("jampmngnzscxaqw", model.resourceType());
        Assertions.assertEquals("chcbonqvpkvlrxnj", model.sku().name());
        Assertions.assertEquals(SkuTier.BASIC, model.sku().tier());
        Assertions.assertEquals("ipheoflokeyyien", model.sku().size());
        Assertions.assertEquals("dlwtgrhpdj", model.sku().family());
        Assertions.assertEquals(523400535, model.sku().capacity());
    }
}
