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

package com.azure.resourcemanager.hdinsight.containers.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hdinsight.containers.models.ComparisonOperator;
import com.azure.resourcemanager.hdinsight.containers.models.ComparisonRule;
import org.junit.jupiter.api.Assertions;

public final class ComparisonRuleTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ComparisonRule model =
            BinaryData
                .fromString("{\"operator\":\"greaterThan\",\"threshold\":36.36004}")
                .toObject(ComparisonRule.class);
        Assertions.assertEquals(ComparisonOperator.GREATER_THAN, model.operator());
        Assertions.assertEquals(36.36004f, model.threshold());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ComparisonRule model =
            new ComparisonRule().withOperator(ComparisonOperator.GREATER_THAN).withThreshold(36.36004f);
        model = BinaryData.fromObject(model).toObject(ComparisonRule.class);
        Assertions.assertEquals(ComparisonOperator.GREATER_THAN, model.operator());
        Assertions.assertEquals(36.36004f, model.threshold());
    }
}
