// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.datamigration.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner;
import com.azure.resourcemanager.datamigration.models.ProjectTaskProperties;
import com.azure.resourcemanager.datamigration.models.TaskList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class TaskListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        TaskList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"etag\":\"xigjyjgzjaoyfhr\",\"properties\":{\"taskType\":\"ProjectTaskProperties\",\"errors\":[],\"state\":\"Unknown\",\"commands\":[]},\"id\":\"rkujy\",\"name\":\"vlejuvfqa\",\"type\":\"rlyxwjkcprbnw\"}],\"nextLink\":\"gjvtbv\"}")
                .toObject(TaskList.class);
        Assertions.assertEquals("xigjyjgzjaoyfhr", model.value().get(0).etag());
        Assertions.assertEquals("gjvtbv", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        TaskList model =
            new TaskList()
                .withValue(
                    Arrays
                        .asList(
                            new ProjectTaskInner()
                                .withEtag("xigjyjgzjaoyfhr")
                                .withProperties(new ProjectTaskProperties())))
                .withNextLink("gjvtbv");
        model = BinaryData.fromObject(model).toObject(TaskList.class);
        Assertions.assertEquals("xigjyjgzjaoyfhr", model.value().get(0).etag());
        Assertions.assertEquals("gjvtbv", model.nextLink());
    }
}
