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

public final class CommandJobLimitsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CommandJobLimits model =
            BinaryData
                .fromString("{\"jobLimitsType\":\"Command\",\"timeout\":\"PT130H21M4S\"}")
                .toObject(CommandJobLimits.class);
        Assertions.assertEquals(Duration.parse("PT130H21M4S"), model.timeout());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CommandJobLimits model = new CommandJobLimits().withTimeout(Duration.parse("PT130H21M4S"));
        model = BinaryData.fromObject(model).toObject(CommandJobLimits.class);
        Assertions.assertEquals(Duration.parse("PT130H21M4S"), model.timeout());
    }
}
