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

package com.azure.resourcemanager.devtestlabs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devtestlabs.fluent.models.LabVhdInner;
import com.azure.resourcemanager.devtestlabs.models.LabVhdList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class LabVhdListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LabVhdList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"id\":\"kzsz\"},{\"id\":\"iwtglxxhljfpg\"},{\"id\":\"crmnzhrgmqgjs\"}],\"nextLink\":\"pqcbfrmbodthsq\"}")
                .toObject(LabVhdList.class);
        Assertions.assertEquals("kzsz", model.value().get(0).id());
        Assertions.assertEquals("pqcbfrmbodthsq", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LabVhdList model =
            new LabVhdList()
                .withValue(
                    Arrays
                        .asList(
                            new LabVhdInner().withId("kzsz"),
                            new LabVhdInner().withId("iwtglxxhljfpg"),
                            new LabVhdInner().withId("crmnzhrgmqgjs")))
                .withNextLink("pqcbfrmbodthsq");
        model = BinaryData.fromObject(model).toObject(LabVhdList.class);
        Assertions.assertEquals("kzsz", model.value().get(0).id());
        Assertions.assertEquals("pqcbfrmbodthsq", model.nextLink());
    }
}
