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

package com.azure.resourcemanager.kusto.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.kusto.models.AzureSku;
import com.azure.resourcemanager.kusto.models.AzureSkuName;
import com.azure.resourcemanager.kusto.models.AzureSkuTier;
import org.junit.jupiter.api.Assertions;

public final class AzureSkuTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AzureSku model =
            BinaryData
                .fromString("{\"name\":\"Standard_E4d_v5\",\"capacity\":743792160,\"tier\":\"Basic\"}")
                .toObject(AzureSku.class);
        Assertions.assertEquals(AzureSkuName.STANDARD_E4D_V5, model.name());
        Assertions.assertEquals(743792160, model.capacity());
        Assertions.assertEquals(AzureSkuTier.BASIC, model.tier());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AzureSku model =
            new AzureSku().withName(AzureSkuName.STANDARD_E4D_V5).withCapacity(743792160).withTier(AzureSkuTier.BASIC);
        model = BinaryData.fromObject(model).toObject(AzureSku.class);
        Assertions.assertEquals(AzureSkuName.STANDARD_E4D_V5, model.name());
        Assertions.assertEquals(743792160, model.capacity());
        Assertions.assertEquals(AzureSkuTier.BASIC, model.tier());
    }
}
