// 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.MedianStoppingPolicy;
import org.junit.jupiter.api.Assertions;

public final class MedianStoppingPolicyTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MedianStoppingPolicy model =
            BinaryData
                .fromString(
                    "{\"policyType\":\"MedianStopping\",\"delayEvaluation\":2026820948,\"evaluationInterval\":660103653}")
                .toObject(MedianStoppingPolicy.class);
        Assertions.assertEquals(2026820948, model.delayEvaluation());
        Assertions.assertEquals(660103653, model.evaluationInterval());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MedianStoppingPolicy model =
            new MedianStoppingPolicy().withDelayEvaluation(2026820948).withEvaluationInterval(660103653);
        model = BinaryData.fromObject(model).toObject(MedianStoppingPolicy.class);
        Assertions.assertEquals(2026820948, model.delayEvaluation());
        Assertions.assertEquals(660103653, model.evaluationInterval());
    }
}
