// 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.FileUploadsNotInAllowedRange;
import java.time.Duration;
import org.junit.jupiter.api.Assertions;

public final class FileUploadsNotInAllowedRangeTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        FileUploadsNotInAllowedRange model =
            BinaryData
                .fromString(
                    "{\"ruleType\":\"FileUploadsNotInAllowedRange\",\"timeWindowSize\":\"PT179H50M54S\",\"minThreshold\":2061950840,\"maxThreshold\":2123887167,\"displayName\":\"sbezaxyfukzxuizh\",\"description\":\"nepk\",\"isEnabled\":true}")
                .toObject(FileUploadsNotInAllowedRange.class);
        Assertions.assertEquals(true, model.isEnabled());
        Assertions.assertEquals(2061950840, model.minThreshold());
        Assertions.assertEquals(2123887167, model.maxThreshold());
        Assertions.assertEquals(Duration.parse("PT179H50M54S"), model.timeWindowSize());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        FileUploadsNotInAllowedRange model =
            new FileUploadsNotInAllowedRange()
                .withIsEnabled(true)
                .withMinThreshold(2061950840)
                .withMaxThreshold(2123887167)
                .withTimeWindowSize(Duration.parse("PT179H50M54S"));
        model = BinaryData.fromObject(model).toObject(FileUploadsNotInAllowedRange.class);
        Assertions.assertEquals(true, model.isEnabled());
        Assertions.assertEquals(2061950840, model.minThreshold());
        Assertions.assertEquals(2123887167, model.maxThreshold());
        Assertions.assertEquals(Duration.parse("PT179H50M54S"), model.timeWindowSize());
    }
}
