// 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.LiveEventTrackEventData;
import com.azure.resourcemanager.mediaservices.models.LiveEventTrackType;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class LiveEventTrackEventDataTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LiveEventTrackEventData model =
            BinaryData
                .fromString(
                    "{\"trackName\":\"vxndz\",\"trackType\":\"video\",\"bitrate\":6325446867505917352,\"incomingBitrate\":5119579042386641262,\"lastTimestamp\":\"orwkqnyh\",\"timescale\":\"ij\",\"overlapCount\":7478255577198949749,\"discontinuityCount\":8746671564071573242,\"nonincreasingCount\":4439293869891812483,\"unexpectedBitrate\":true,\"state\":\"systawfsdjp\",\"healthy\":false,\"lastFragmentArrivalTime\":\"2021-12-06T03:48:21Z\",\"ingestDriftValue\":\"xbkzbzkdvncj\",\"transcriptionState\":\"udurgkakmokz\",\"transcriptionLanguage\":\"jk\"}")
                .toObject(LiveEventTrackEventData.class);
        Assertions.assertEquals("vxndz", model.trackName());
        Assertions.assertEquals(LiveEventTrackType.VIDEO, model.trackType());
        Assertions.assertEquals(6325446867505917352L, model.bitrate());
        Assertions.assertEquals(5119579042386641262L, model.incomingBitrate());
        Assertions.assertEquals("orwkqnyh", model.lastTimestamp());
        Assertions.assertEquals("ij", model.timescale());
        Assertions.assertEquals(7478255577198949749L, model.overlapCount());
        Assertions.assertEquals(8746671564071573242L, model.discontinuityCount());
        Assertions.assertEquals(4439293869891812483L, model.nonincreasingCount());
        Assertions.assertEquals(true, model.unexpectedBitrate());
        Assertions.assertEquals("systawfsdjp", model.state());
        Assertions.assertEquals(false, model.healthy());
        Assertions.assertEquals(OffsetDateTime.parse("2021-12-06T03:48:21Z"), model.lastFragmentArrivalTime());
        Assertions.assertEquals("xbkzbzkdvncj", model.ingestDriftValue());
        Assertions.assertEquals("udurgkakmokz", model.transcriptionState());
        Assertions.assertEquals("jk", model.transcriptionLanguage());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LiveEventTrackEventData model =
            new LiveEventTrackEventData()
                .withTrackName("vxndz")
                .withTrackType(LiveEventTrackType.VIDEO)
                .withBitrate(6325446867505917352L)
                .withIncomingBitrate(5119579042386641262L)
                .withLastTimestamp("orwkqnyh")
                .withTimescale("ij")
                .withOverlapCount(7478255577198949749L)
                .withDiscontinuityCount(8746671564071573242L)
                .withNonincreasingCount(4439293869891812483L)
                .withUnexpectedBitrate(true)
                .withState("systawfsdjp")
                .withHealthy(false)
                .withLastFragmentArrivalTime(OffsetDateTime.parse("2021-12-06T03:48:21Z"))
                .withIngestDriftValue("xbkzbzkdvncj")
                .withTranscriptionState("udurgkakmokz")
                .withTranscriptionLanguage("jk");
        model = BinaryData.fromObject(model).toObject(LiveEventTrackEventData.class);
        Assertions.assertEquals("vxndz", model.trackName());
        Assertions.assertEquals(LiveEventTrackType.VIDEO, model.trackType());
        Assertions.assertEquals(6325446867505917352L, model.bitrate());
        Assertions.assertEquals(5119579042386641262L, model.incomingBitrate());
        Assertions.assertEquals("orwkqnyh", model.lastTimestamp());
        Assertions.assertEquals("ij", model.timescale());
        Assertions.assertEquals(7478255577198949749L, model.overlapCount());
        Assertions.assertEquals(8746671564071573242L, model.discontinuityCount());
        Assertions.assertEquals(4439293869891812483L, model.nonincreasingCount());
        Assertions.assertEquals(true, model.unexpectedBitrate());
        Assertions.assertEquals("systawfsdjp", model.state());
        Assertions.assertEquals(false, model.healthy());
        Assertions.assertEquals(OffsetDateTime.parse("2021-12-06T03:48:21Z"), model.lastFragmentArrivalTime());
        Assertions.assertEquals("xbkzbzkdvncj", model.ingestDriftValue());
        Assertions.assertEquals("udurgkakmokz", model.transcriptionState());
        Assertions.assertEquals("jk", model.transcriptionLanguage());
    }
}
