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

public final class PresentationTimeRangeTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PresentationTimeRange model =
            BinaryData
                .fromString(
                    "{\"startTimestamp\":8620711774108455397,\"endTimestamp\":2115374097438254062,\"presentationWindowDuration\":5606993477274811025,\"liveBackoffDuration\":3412578426964637128,\"timescale\":5597579256870764074,\"forceEndTimestamp\":false}")
                .toObject(PresentationTimeRange.class);
        Assertions.assertEquals(8620711774108455397L, model.startTimestamp());
        Assertions.assertEquals(2115374097438254062L, model.endTimestamp());
        Assertions.assertEquals(5606993477274811025L, model.presentationWindowDuration());
        Assertions.assertEquals(3412578426964637128L, model.liveBackoffDuration());
        Assertions.assertEquals(5597579256870764074L, model.timescale());
        Assertions.assertEquals(false, model.forceEndTimestamp());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PresentationTimeRange model =
            new PresentationTimeRange()
                .withStartTimestamp(8620711774108455397L)
                .withEndTimestamp(2115374097438254062L)
                .withPresentationWindowDuration(5606993477274811025L)
                .withLiveBackoffDuration(3412578426964637128L)
                .withTimescale(5597579256870764074L)
                .withForceEndTimestamp(false);
        model = BinaryData.fromObject(model).toObject(PresentationTimeRange.class);
        Assertions.assertEquals(8620711774108455397L, model.startTimestamp());
        Assertions.assertEquals(2115374097438254062L, model.endTimestamp());
        Assertions.assertEquals(5606993477274811025L, model.presentationWindowDuration());
        Assertions.assertEquals(3412578426964637128L, model.liveBackoffDuration());
        Assertions.assertEquals(5597579256870764074L, model.timescale());
        Assertions.assertEquals(false, model.forceEndTimestamp());
    }
}
