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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.TruncationSelectionPolicy;
import org.junit.jupiter.api.Assertions;

public final class TruncationSelectionPolicyTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        TruncationSelectionPolicy model =
            BinaryData
                .fromString(
                    "{\"policyType\":\"TruncationSelection\",\"truncationPercentage\":1106944697,\"delayEvaluation\":674073421,\"evaluationInterval\":1924509674}")
                .toObject(TruncationSelectionPolicy.class);
        Assertions.assertEquals(674073421, model.delayEvaluation());
        Assertions.assertEquals(1924509674, model.evaluationInterval());
        Assertions.assertEquals(1106944697, model.truncationPercentage());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        TruncationSelectionPolicy model =
            new TruncationSelectionPolicy()
                .withDelayEvaluation(674073421)
                .withEvaluationInterval(1924509674)
                .withTruncationPercentage(1106944697);
        model = BinaryData.fromObject(model).toObject(TruncationSelectionPolicy.class);
        Assertions.assertEquals(674073421, model.delayEvaluation());
        Assertions.assertEquals(1924509674, model.evaluationInterval());
        Assertions.assertEquals(1106944697, model.truncationPercentage());
    }
}
