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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.fluent.models.WorkloadGroupInner;
import org.junit.jupiter.api.Assertions;

public final class WorkloadGroupInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkloadGroupInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"minResourcePercent\":1591499316,\"maxResourcePercent\":122803528,\"minResourcePercentPerRequest\":21.702799317843912,\"maxResourcePercentPerRequest\":97.4438256079908,\"importance\":\"b\",\"queryExecutionTimeout\":1947593422},\"id\":\"ilbywdxsm\",\"name\":\"ccwr\",\"type\":\"fscjfnynszquji\"}")
                .toObject(WorkloadGroupInner.class);
        Assertions.assertEquals(1591499316, model.minResourcePercent());
        Assertions.assertEquals(122803528, model.maxResourcePercent());
        Assertions.assertEquals(21.702799317843912, model.minResourcePercentPerRequest());
        Assertions.assertEquals(97.4438256079908D, model.maxResourcePercentPerRequest());
        Assertions.assertEquals("b", model.importance());
        Assertions.assertEquals(1947593422, model.queryExecutionTimeout());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkloadGroupInner model =
            new WorkloadGroupInner()
                .withMinResourcePercent(1591499316)
                .withMaxResourcePercent(122803528)
                .withMinResourcePercentPerRequest(21.702799317843912)
                .withMaxResourcePercentPerRequest(97.4438256079908D)
                .withImportance("b")
                .withQueryExecutionTimeout(1947593422);
        model = BinaryData.fromObject(model).toObject(WorkloadGroupInner.class);
        Assertions.assertEquals(1591499316, model.minResourcePercent());
        Assertions.assertEquals(122803528, model.maxResourcePercent());
        Assertions.assertEquals(21.702799317843912, model.minResourcePercentPerRequest());
        Assertions.assertEquals(97.4438256079908D, model.maxResourcePercentPerRequest());
        Assertions.assertEquals("b", model.importance());
        Assertions.assertEquals(1947593422, model.queryExecutionTimeout());
    }
}
