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

public final class NlpVerticalLimitSettingsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NlpVerticalLimitSettings model =
            BinaryData
                .fromString("{\"maxConcurrentTrials\":422661668,\"maxTrials\":768209268,\"timeout\":\"PT230H9M19S\"}")
                .toObject(NlpVerticalLimitSettings.class);
        Assertions.assertEquals(422661668, model.maxConcurrentTrials());
        Assertions.assertEquals(768209268, model.maxTrials());
        Assertions.assertEquals(Duration.parse("PT230H9M19S"), model.timeout());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NlpVerticalLimitSettings model =
            new NlpVerticalLimitSettings()
                .withMaxConcurrentTrials(422661668)
                .withMaxTrials(768209268)
                .withTimeout(Duration.parse("PT230H9M19S"));
        model = BinaryData.fromObject(model).toObject(NlpVerticalLimitSettings.class);
        Assertions.assertEquals(422661668, model.maxConcurrentTrials());
        Assertions.assertEquals(768209268, model.maxTrials());
        Assertions.assertEquals(Duration.parse("PT230H9M19S"), model.timeout());
    }
}
