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

package com.azure.resourcemanager.mediaservices.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mediaservices.models.AbsoluteClipTime;
import java.time.Duration;
import org.junit.jupiter.api.Assertions;

public final class AbsoluteClipTimeTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AbsoluteClipTime model =
            BinaryData
                .fromString("{\"@odata.type\":\"#Microsoft.Media.AbsoluteClipTime\",\"time\":\"PT86H5M17S\"}")
                .toObject(AbsoluteClipTime.class);
        Assertions.assertEquals(Duration.parse("PT86H5M17S"), model.time());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AbsoluteClipTime model = new AbsoluteClipTime().withTime(Duration.parse("PT86H5M17S"));
        model = BinaryData.fromObject(model).toObject(AbsoluteClipTime.class);
        Assertions.assertEquals(Duration.parse("PT86H5M17S"), model.time());
    }
}
