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

package com.azure.resourcemanager.mariadb.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mariadb.models.GeoRedundantBackup;
import com.azure.resourcemanager.mariadb.models.StorageAutogrow;
import com.azure.resourcemanager.mariadb.models.StorageProfile;
import org.junit.jupiter.api.Assertions;

public final class StorageProfileTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        StorageProfile model =
            BinaryData
                .fromString(
                    "{\"backupRetentionDays\":601268048,\"geoRedundantBackup\":\"Enabled\",\"storageMB\":1933182137,\"storageAutogrow\":\"Enabled\"}")
                .toObject(StorageProfile.class);
        Assertions.assertEquals(601268048, model.backupRetentionDays());
        Assertions.assertEquals(GeoRedundantBackup.ENABLED, model.geoRedundantBackup());
        Assertions.assertEquals(1933182137, model.storageMB());
        Assertions.assertEquals(StorageAutogrow.ENABLED, model.storageAutogrow());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        StorageProfile model =
            new StorageProfile()
                .withBackupRetentionDays(601268048)
                .withGeoRedundantBackup(GeoRedundantBackup.ENABLED)
                .withStorageMB(1933182137)
                .withStorageAutogrow(StorageAutogrow.ENABLED);
        model = BinaryData.fromObject(model).toObject(StorageProfile.class);
        Assertions.assertEquals(601268048, model.backupRetentionDays());
        Assertions.assertEquals(GeoRedundantBackup.ENABLED, model.geoRedundantBackup());
        Assertions.assertEquals(1933182137, model.storageMB());
        Assertions.assertEquals(StorageAutogrow.ENABLED, model.storageAutogrow());
    }
}
