// 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.LiveEventInputTrackSelection;
import com.azure.resourcemanager.mediaservices.models.LiveEventOutputTranscriptionTrack;
import com.azure.resourcemanager.mediaservices.models.LiveEventTranscription;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class LiveEventTranscriptionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LiveEventTranscription model =
            BinaryData
                .fromString(
                    "{\"language\":\"yqagvrvm\",\"inputTrackSelection\":[{\"property\":\"kghimdblxgwimfnj\",\"operation\":\"j\",\"value\":\"mszkkfo\"}],\"outputTranscriptionTrack\":{\"trackName\":\"eyfkzikfja\"}}")
                .toObject(LiveEventTranscription.class);
        Assertions.assertEquals("yqagvrvm", model.language());
        Assertions.assertEquals("kghimdblxgwimfnj", model.inputTrackSelection().get(0).property());
        Assertions.assertEquals("j", model.inputTrackSelection().get(0).operation());
        Assertions.assertEquals("mszkkfo", model.inputTrackSelection().get(0).value());
        Assertions.assertEquals("eyfkzikfja", model.outputTranscriptionTrack().trackName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LiveEventTranscription model =
            new LiveEventTranscription()
                .withLanguage("yqagvrvm")
                .withInputTrackSelection(
                    Arrays
                        .asList(
                            new LiveEventInputTrackSelection()
                                .withProperty("kghimdblxgwimfnj")
                                .withOperation("j")
                                .withValue("mszkkfo")))
                .withOutputTranscriptionTrack(new LiveEventOutputTranscriptionTrack().withTrackName("eyfkzikfja"));
        model = BinaryData.fromObject(model).toObject(LiveEventTranscription.class);
        Assertions.assertEquals("yqagvrvm", model.language());
        Assertions.assertEquals("kghimdblxgwimfnj", model.inputTrackSelection().get(0).property());
        Assertions.assertEquals("j", model.inputTrackSelection().get(0).operation());
        Assertions.assertEquals("mszkkfo", model.inputTrackSelection().get(0).value());
        Assertions.assertEquals("eyfkzikfja", model.outputTranscriptionTrack().trackName());
    }
}
