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

public final class StreamingPolicyContentKeyTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        StreamingPolicyContentKey model =
            BinaryData
                .fromString(
                    "{\"label\":\"doy\",\"policyName\":\"ifthnz\",\"tracks\":[{\"trackSelections\":[]},{\"trackSelections\":[]},{\"trackSelections\":[]},{\"trackSelections\":[]}]}")
                .toObject(StreamingPolicyContentKey.class);
        Assertions.assertEquals("doy", model.label());
        Assertions.assertEquals("ifthnz", model.policyName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        StreamingPolicyContentKey model =
            new StreamingPolicyContentKey()
                .withLabel("doy")
                .withPolicyName("ifthnz")
                .withTracks(
                    Arrays
                        .asList(
                            new TrackSelection().withTrackSelections(Arrays.asList()),
                            new TrackSelection().withTrackSelections(Arrays.asList()),
                            new TrackSelection().withTrackSelections(Arrays.asList()),
                            new TrackSelection().withTrackSelections(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(StreamingPolicyContentKey.class);
        Assertions.assertEquals("doy", model.label());
        Assertions.assertEquals("ifthnz", model.policyName());
    }
}
