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

package com.azure.resourcemanager.workloads.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.workloads.models.SapDatabaseScaleMethod;
import com.azure.resourcemanager.workloads.models.SapDatabaseType;
import com.azure.resourcemanager.workloads.models.SapDeploymentType;
import com.azure.resourcemanager.workloads.models.SapEnvironmentType;
import com.azure.resourcemanager.workloads.models.SapHighAvailabilityType;
import com.azure.resourcemanager.workloads.models.SapProductType;
import com.azure.resourcemanager.workloads.models.SapSizingRecommendationRequest;
import org.junit.jupiter.api.Assertions;

public final class SapSizingRecommendationRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SapSizingRecommendationRequest model =
            BinaryData
                .fromString(
                    "{\"appLocation\":\"mmhquvgjxpyb\",\"environment\":\"NonProd\",\"sapProduct\":\"ECC\",\"deploymentType\":\"SingleServer\",\"saps\":5740075632492893459,\"dbMemory\":8216479127673757607,\"databaseType\":\"HANA\",\"dbScaleMethod\":\"ScaleUp\",\"highAvailabilityType\":\"AvailabilityZone\"}")
                .toObject(SapSizingRecommendationRequest.class);
        Assertions.assertEquals("mmhquvgjxpyb", model.appLocation());
        Assertions.assertEquals(SapEnvironmentType.NON_PROD, model.environment());
        Assertions.assertEquals(SapProductType.ECC, model.sapProduct());
        Assertions.assertEquals(SapDeploymentType.SINGLE_SERVER, model.deploymentType());
        Assertions.assertEquals(5740075632492893459L, model.saps());
        Assertions.assertEquals(8216479127673757607L, model.dbMemory());
        Assertions.assertEquals(SapDatabaseType.HANA, model.databaseType());
        Assertions.assertEquals(SapDatabaseScaleMethod.SCALE_UP, model.dbScaleMethod());
        Assertions.assertEquals(SapHighAvailabilityType.AVAILABILITY_ZONE, model.highAvailabilityType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SapSizingRecommendationRequest model =
            new SapSizingRecommendationRequest()
                .withAppLocation("mmhquvgjxpyb")
                .withEnvironment(SapEnvironmentType.NON_PROD)
                .withSapProduct(SapProductType.ECC)
                .withDeploymentType(SapDeploymentType.SINGLE_SERVER)
                .withSaps(5740075632492893459L)
                .withDbMemory(8216479127673757607L)
                .withDatabaseType(SapDatabaseType.HANA)
                .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP)
                .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE);
        model = BinaryData.fromObject(model).toObject(SapSizingRecommendationRequest.class);
        Assertions.assertEquals("mmhquvgjxpyb", model.appLocation());
        Assertions.assertEquals(SapEnvironmentType.NON_PROD, model.environment());
        Assertions.assertEquals(SapProductType.ECC, model.sapProduct());
        Assertions.assertEquals(SapDeploymentType.SINGLE_SERVER, model.deploymentType());
        Assertions.assertEquals(5740075632492893459L, model.saps());
        Assertions.assertEquals(8216479127673757607L, model.dbMemory());
        Assertions.assertEquals(SapDatabaseType.HANA, model.databaseType());
        Assertions.assertEquals(SapDatabaseScaleMethod.SCALE_UP, model.dbScaleMethod());
        Assertions.assertEquals(SapHighAvailabilityType.AVAILABILITY_ZONE, model.highAvailabilityType());
    }
}
