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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.PartialSku;
import com.azure.resourcemanager.machinelearning.models.SkuTier;
import org.junit.jupiter.api.Assertions;

public final class PartialSkuTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PartialSku model =
            BinaryData
                .fromString(
                    "{\"capacity\":1425632159,\"family\":\"swvefloccsrmoz\",\"name\":\"m\",\"size\":\"g\",\"tier\":\"Free\"}")
                .toObject(PartialSku.class);
        Assertions.assertEquals(1425632159, model.capacity());
        Assertions.assertEquals("swvefloccsrmoz", model.family());
        Assertions.assertEquals("m", model.name());
        Assertions.assertEquals("g", model.size());
        Assertions.assertEquals(SkuTier.FREE, model.tier());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PartialSku model =
            new PartialSku()
                .withCapacity(1425632159)
                .withFamily("swvefloccsrmoz")
                .withName("m")
                .withSize("g")
                .withTier(SkuTier.FREE);
        model = BinaryData.fromObject(model).toObject(PartialSku.class);
        Assertions.assertEquals(1425632159, model.capacity());
        Assertions.assertEquals("swvefloccsrmoz", model.family());
        Assertions.assertEquals("m", model.name());
        Assertions.assertEquals("g", model.size());
        Assertions.assertEquals(SkuTier.FREE, model.tier());
    }
}
