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

package com.azure.resourcemanager.powerbidedicated.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.powerbidedicated.models.CapacitySku;
import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier;
import com.azure.resourcemanager.powerbidedicated.models.SkuDetailsForExistingResource;
import org.junit.jupiter.api.Assertions;

public final class SkuDetailsForExistingResourceTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SkuDetailsForExistingResource model =
            BinaryData
                .fromString(
                    "{\"resourceType\":\"jysvl\",\"sku\":{\"name\":\"uvfqawrlyxwj\",\"tier\":\"AutoPremiumHost\",\"capacity\":2115233391}}")
                .toObject(SkuDetailsForExistingResource.class);
        Assertions.assertEquals("jysvl", model.resourceType());
        Assertions.assertEquals("uvfqawrlyxwj", model.sku().name());
        Assertions.assertEquals(CapacitySkuTier.AUTO_PREMIUM_HOST, model.sku().tier());
        Assertions.assertEquals(2115233391, model.sku().capacity());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SkuDetailsForExistingResource model =
            new SkuDetailsForExistingResource()
                .withResourceType("jysvl")
                .withSku(
                    new CapacitySku()
                        .withName("uvfqawrlyxwj")
                        .withTier(CapacitySkuTier.AUTO_PREMIUM_HOST)
                        .withCapacity(2115233391));
        model = BinaryData.fromObject(model).toObject(SkuDetailsForExistingResource.class);
        Assertions.assertEquals("jysvl", model.resourceType());
        Assertions.assertEquals("uvfqawrlyxwj", model.sku().name());
        Assertions.assertEquals(CapacitySkuTier.AUTO_PREMIUM_HOST, model.sku().tier());
        Assertions.assertEquals(2115233391, model.sku().capacity());
    }
}
