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

package com.azure.resourcemanager.networkcloud.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.networkcloud.models.ValidationThreshold;
import com.azure.resourcemanager.networkcloud.models.ValidationThresholdGrouping;
import com.azure.resourcemanager.networkcloud.models.ValidationThresholdType;
import org.junit.jupiter.api.Assertions;

public final class ValidationThresholdTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ValidationThreshold model =
            BinaryData
                .fromString("{\"grouping\":\"PerRack\",\"type\":\"CountSuccess\",\"value\":5284833703695885613}")
                .toObject(ValidationThreshold.class);
        Assertions.assertEquals(ValidationThresholdGrouping.PER_RACK, model.grouping());
        Assertions.assertEquals(ValidationThresholdType.COUNT_SUCCESS, model.type());
        Assertions.assertEquals(5284833703695885613L, model.value());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ValidationThreshold model =
            new ValidationThreshold()
                .withGrouping(ValidationThresholdGrouping.PER_RACK)
                .withType(ValidationThresholdType.COUNT_SUCCESS)
                .withValue(5284833703695885613L);
        model = BinaryData.fromObject(model).toObject(ValidationThreshold.class);
        Assertions.assertEquals(ValidationThresholdGrouping.PER_RACK, model.grouping());
        Assertions.assertEquals(ValidationThresholdType.COUNT_SUCCESS, model.type());
        Assertions.assertEquals(5284833703695885613L, model.value());
    }
}
