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

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule;
import org.junit.jupiter.api.Assertions;

public final class ThresholdCustomAlertRuleTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ThresholdCustomAlertRule model =
            BinaryData
                .fromString(
                    "{\"ruleType\":\"ThresholdCustomAlertRule\",\"minThreshold\":1382683860,\"maxThreshold\":1200482188,\"displayName\":\"yktz\",\"description\":\"u\",\"isEnabled\":false}")
                .toObject(ThresholdCustomAlertRule.class);
        Assertions.assertEquals(false, model.isEnabled());
        Assertions.assertEquals(1382683860, model.minThreshold());
        Assertions.assertEquals(1200482188, model.maxThreshold());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ThresholdCustomAlertRule model =
            new ThresholdCustomAlertRule()
                .withIsEnabled(false)
                .withMinThreshold(1382683860)
                .withMaxThreshold(1200482188);
        model = BinaryData.fromObject(model).toObject(ThresholdCustomAlertRule.class);
        Assertions.assertEquals(false, model.isEnabled());
        Assertions.assertEquals(1382683860, model.minThreshold());
        Assertions.assertEquals(1200482188, model.maxThreshold());
    }
}
