// 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.PoolUpdateProperties;
import com.azure.resourcemanager.devcenter.models.LicenseType;
import com.azure.resourcemanager.devcenter.models.LocalAdminStatus;
import com.azure.resourcemanager.devcenter.models.StopOnDisconnectConfiguration;
import com.azure.resourcemanager.devcenter.models.StopOnDisconnectEnableStatus;
import org.junit.jupiter.api.Assertions;

public final class PoolUpdatePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PoolUpdateProperties model =
            BinaryData
                .fromString(
                    "{\"devBoxDefinitionName\":\"cktqumiekkezzi\",\"networkConnectionName\":\"ly\",\"licenseType\":\"Windows_Client\",\"localAdministrator\":\"Enabled\",\"stopOnDisconnect\":{\"status\":\"Disabled\",\"gracePeriodMinutes\":558583308}}")
                .toObject(PoolUpdateProperties.class);
        Assertions.assertEquals("cktqumiekkezzi", model.devBoxDefinitionName());
        Assertions.assertEquals("ly", model.networkConnectionName());
        Assertions.assertEquals(LicenseType.WINDOWS_CLIENT, model.licenseType());
        Assertions.assertEquals(LocalAdminStatus.ENABLED, model.localAdministrator());
        Assertions.assertEquals(StopOnDisconnectEnableStatus.DISABLED, model.stopOnDisconnect().status());
        Assertions.assertEquals(558583308, model.stopOnDisconnect().gracePeriodMinutes());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PoolUpdateProperties model =
            new PoolUpdateProperties()
                .withDevBoxDefinitionName("cktqumiekkezzi")
                .withNetworkConnectionName("ly")
                .withLicenseType(LicenseType.WINDOWS_CLIENT)
                .withLocalAdministrator(LocalAdminStatus.ENABLED)
                .withStopOnDisconnect(
                    new StopOnDisconnectConfiguration()
                        .withStatus(StopOnDisconnectEnableStatus.DISABLED)
                        .withGracePeriodMinutes(558583308));
        model = BinaryData.fromObject(model).toObject(PoolUpdateProperties.class);
        Assertions.assertEquals("cktqumiekkezzi", model.devBoxDefinitionName());
        Assertions.assertEquals("ly", model.networkConnectionName());
        Assertions.assertEquals(LicenseType.WINDOWS_CLIENT, model.licenseType());
        Assertions.assertEquals(LocalAdminStatus.ENABLED, model.localAdministrator());
        Assertions.assertEquals(StopOnDisconnectEnableStatus.DISABLED, model.stopOnDisconnect().status());
        Assertions.assertEquals(558583308, model.stopOnDisconnect().gracePeriodMinutes());
    }
}
