// 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.WorkloadGroupProperties;
import org.junit.jupiter.api.Assertions;

public final class WorkloadGroupPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkloadGroupProperties model =
            BinaryData
                .fromString(
                    "{\"minResourcePercent\":1527085818,\"maxResourcePercent\":1296747978,\"minResourcePercentPerRequest\":84.31488864287606,\"maxResourcePercentPerRequest\":21.38076853827919,\"importance\":\"yo\",\"queryExecutionTimeout\":853520386}")
                .toObject(WorkloadGroupProperties.class);
        Assertions.assertEquals(1527085818, model.minResourcePercent());
        Assertions.assertEquals(1296747978, model.maxResourcePercent());
        Assertions.assertEquals(84.31488864287606, model.minResourcePercentPerRequest());
        Assertions.assertEquals(21.38076853827919D, model.maxResourcePercentPerRequest());
        Assertions.assertEquals("yo", model.importance());
        Assertions.assertEquals(853520386, model.queryExecutionTimeout());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkloadGroupProperties model =
            new WorkloadGroupProperties()
                .withMinResourcePercent(1527085818)
                .withMaxResourcePercent(1296747978)
                .withMinResourcePercentPerRequest(84.31488864287606)
                .withMaxResourcePercentPerRequest(21.38076853827919D)
                .withImportance("yo")
                .withQueryExecutionTimeout(853520386);
        model = BinaryData.fromObject(model).toObject(WorkloadGroupProperties.class);
        Assertions.assertEquals(1527085818, model.minResourcePercent());
        Assertions.assertEquals(1296747978, model.maxResourcePercent());
        Assertions.assertEquals(84.31488864287606, model.minResourcePercentPerRequest());
        Assertions.assertEquals(21.38076853827919D, model.maxResourcePercentPerRequest());
        Assertions.assertEquals("yo", model.importance());
        Assertions.assertEquals(853520386, model.queryExecutionTimeout());
    }
}
