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

public final class TransformCollectionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        TransformCollection model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"created\":\"2021-06-13T13:40:46Z\",\"description\":\"j\",\"lastModified\":\"2021-05-23T22:50:57Z\",\"outputs\":[]},\"id\":\"ucww\",\"name\":\"vo\",\"type\":\"bvmeuecivy\"},{\"properties\":{\"created\":\"2021-09-20T10:59:48Z\",\"description\":\"ojgjrwjueiotwmc\",\"lastModified\":\"2021-05-30T22:11:56Z\",\"outputs\":[]},\"id\":\"x\",\"name\":\"it\",\"type\":\"nrjawgqwg\"},{\"properties\":{\"created\":\"2021-12-08T22:59:31Z\",\"description\":\"kxfbkpycgklwndn\",\"lastModified\":\"2021-06-18T07:43:59Z\",\"outputs\":[]},\"id\":\"uwhvylwzbtdhxujz\",\"name\":\"bm\",\"type\":\"ow\"}],\"@odata.nextLink\":\"przqlveu\"}")
                .toObject(TransformCollection.class);
        Assertions.assertEquals("j", model.value().get(0).description());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        TransformCollection model =
            new TransformCollection()
                .withValue(
                    Arrays
                        .asList(
                            new TransformInner().withDescription("j").withOutputs(Arrays.asList()),
                            new TransformInner().withDescription("ojgjrwjueiotwmc").withOutputs(Arrays.asList()),
                            new TransformInner().withDescription("kxfbkpycgklwndn").withOutputs(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(TransformCollection.class);
        Assertions.assertEquals("j", model.value().get(0).description());
    }
}
