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

package com.azure.resourcemanager.datadog.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.datadog.fluent.models.LinkedResourceInner;
import com.azure.resourcemanager.datadog.models.LinkedResourceListResponse;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class LinkedResourceListResponseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LinkedResourceListResponse model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"id\":\"ckbasyypndd\"},{\"id\":\"gcbacphejkot\"},{\"id\":\"qgoulznd\"},{\"id\":\"kwy\"}],\"nextLink\":\"gfgibm\"}")
                .toObject(LinkedResourceListResponse.class);
        Assertions.assertEquals("ckbasyypndd", model.value().get(0).id());
        Assertions.assertEquals("gfgibm", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LinkedResourceListResponse model =
            new LinkedResourceListResponse()
                .withValue(
                    Arrays
                        .asList(
                            new LinkedResourceInner().withId("ckbasyypndd"),
                            new LinkedResourceInner().withId("gcbacphejkot"),
                            new LinkedResourceInner().withId("qgoulznd"),
                            new LinkedResourceInner().withId("kwy")))
                .withNextLink("gfgibm");
        model = BinaryData.fromObject(model).toObject(LinkedResourceListResponse.class);
        Assertions.assertEquals("ckbasyypndd", model.value().get(0).id());
        Assertions.assertEquals("gfgibm", model.nextLink());
    }
}
