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

package com.azure.resourcemanager.netapp.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.netapp.fluent.models.PoolProperties;
import com.azure.resourcemanager.netapp.models.EncryptionType;
import com.azure.resourcemanager.netapp.models.QosType;
import com.azure.resourcemanager.netapp.models.ServiceLevel;
import org.junit.jupiter.api.Assertions;

public final class PoolPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PoolProperties model =
            BinaryData
                .fromString(
                    "{\"poolId\":\"ez\",\"size\":312330781949213255,\"serviceLevel\":\"StandardZRS\",\"provisioningState\":\"mzsb\",\"totalThroughputMibps\":69.09377,\"utilizedThroughputMibps\":19.846666,\"qosType\":\"Auto\",\"coolAccess\":true,\"encryptionType\":\"Double\"}")
                .toObject(PoolProperties.class);
        Assertions.assertEquals(312330781949213255L, model.size());
        Assertions.assertEquals(ServiceLevel.STANDARD_ZRS, model.serviceLevel());
        Assertions.assertEquals(QosType.AUTO, model.qosType());
        Assertions.assertEquals(true, model.coolAccess());
        Assertions.assertEquals(EncryptionType.DOUBLE, model.encryptionType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PoolProperties model =
            new PoolProperties()
                .withSize(312330781949213255L)
                .withServiceLevel(ServiceLevel.STANDARD_ZRS)
                .withQosType(QosType.AUTO)
                .withCoolAccess(true)
                .withEncryptionType(EncryptionType.DOUBLE);
        model = BinaryData.fromObject(model).toObject(PoolProperties.class);
        Assertions.assertEquals(312330781949213255L, model.size());
        Assertions.assertEquals(ServiceLevel.STANDARD_ZRS, model.serviceLevel());
        Assertions.assertEquals(QosType.AUTO, model.qosType());
        Assertions.assertEquals(true, model.coolAccess());
        Assertions.assertEquals(EncryptionType.DOUBLE, model.encryptionType());
    }
}
