// 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.DevBoxDefinitionUpdateProperties;
import com.azure.resourcemanager.devcenter.models.HibernateSupport;
import com.azure.resourcemanager.devcenter.models.ImageReference;
import com.azure.resourcemanager.devcenter.models.Sku;
import com.azure.resourcemanager.devcenter.models.SkuTier;
import org.junit.jupiter.api.Assertions;

public final class DevBoxDefinitionUpdatePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DevBoxDefinitionUpdateProperties model =
            BinaryData
                .fromString(
                    "{\"imageReference\":{\"id\":\"pnapnyiropuh\",\"exactVersion\":\"gvpgy\"},\"sku\":{\"name\":\"qgitxmed\",\"tier\":\"Free\",\"size\":\"lynqwwncwzzh\",\"family\":\"ktrmgucnapkt\",\"capacity\":203480893},\"osStorageType\":\"lwptfdy\",\"hibernateSupport\":\"Enabled\"}")
                .toObject(DevBoxDefinitionUpdateProperties.class);
        Assertions.assertEquals("pnapnyiropuh", model.imageReference().id());
        Assertions.assertEquals("qgitxmed", model.sku().name());
        Assertions.assertEquals(SkuTier.FREE, model.sku().tier());
        Assertions.assertEquals("lynqwwncwzzh", model.sku().size());
        Assertions.assertEquals("ktrmgucnapkt", model.sku().family());
        Assertions.assertEquals(203480893, model.sku().capacity());
        Assertions.assertEquals("lwptfdy", model.osStorageType());
        Assertions.assertEquals(HibernateSupport.ENABLED, model.hibernateSupport());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DevBoxDefinitionUpdateProperties model =
            new DevBoxDefinitionUpdateProperties()
                .withImageReference(new ImageReference().withId("pnapnyiropuh"))
                .withSku(
                    new Sku()
                        .withName("qgitxmed")
                        .withTier(SkuTier.FREE)
                        .withSize("lynqwwncwzzh")
                        .withFamily("ktrmgucnapkt")
                        .withCapacity(203480893))
                .withOsStorageType("lwptfdy")
                .withHibernateSupport(HibernateSupport.ENABLED);
        model = BinaryData.fromObject(model).toObject(DevBoxDefinitionUpdateProperties.class);
        Assertions.assertEquals("pnapnyiropuh", model.imageReference().id());
        Assertions.assertEquals("qgitxmed", model.sku().name());
        Assertions.assertEquals(SkuTier.FREE, model.sku().tier());
        Assertions.assertEquals("lynqwwncwzzh", model.sku().size());
        Assertions.assertEquals("ktrmgucnapkt", model.sku().family());
        Assertions.assertEquals(203480893, model.sku().capacity());
        Assertions.assertEquals("lwptfdy", model.osStorageType());
        Assertions.assertEquals(HibernateSupport.ENABLED, model.hibernateSupport());
    }
}
