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

package com.azure.resourcemanager.devcenter.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devcenter.fluent.models.DevCenterSkuInner;
import com.azure.resourcemanager.devcenter.models.SkuTier;
import org.junit.jupiter.api.Assertions;

public final class DevCenterSkuInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DevCenterSkuInner model =
            BinaryData
                .fromString(
                    "{\"resourceType\":\"fnndl\",\"locations\":[\"hkoymkcdyhbp\",\"kpw\",\"reqnovvqfov\"],\"capabilities\":[{\"name\":\"wsuwsyr\",\"value\":\"dsytgadgvr\"},{\"name\":\"aeneqnzarrwl\",\"value\":\"uijfqk\"}],\"name\":\"cewiipfpub\",\"tier\":\"Basic\",\"size\":\"wifto\",\"family\":\"kvpuvksgplsaknyn\",\"capacity\":654967336}")
                .toObject(DevCenterSkuInner.class);
        Assertions.assertEquals("cewiipfpub", model.name());
        Assertions.assertEquals(SkuTier.BASIC, model.tier());
        Assertions.assertEquals("wifto", model.size());
        Assertions.assertEquals("kvpuvksgplsaknyn", model.family());
        Assertions.assertEquals(654967336, model.capacity());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DevCenterSkuInner model =
            new DevCenterSkuInner()
                .withName("cewiipfpub")
                .withTier(SkuTier.BASIC)
                .withSize("wifto")
                .withFamily("kvpuvksgplsaknyn")
                .withCapacity(654967336);
        model = BinaryData.fromObject(model).toObject(DevCenterSkuInner.class);
        Assertions.assertEquals("cewiipfpub", model.name());
        Assertions.assertEquals(SkuTier.BASIC, model.tier());
        Assertions.assertEquals("wifto", model.size());
        Assertions.assertEquals("kvpuvksgplsaknyn", model.family());
        Assertions.assertEquals(654967336, model.capacity());
    }
}
