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

package com.azure.resourcemanager.logz.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.logz.fluent.models.VMResourcesInner;
import com.azure.resourcemanager.logz.models.VMResourcesListResponse;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class VMResourcesListResponseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VMResourcesListResponse model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"id\":\"jj\",\"agentVersion\":\"v\"},{\"id\":\"dgwdslfhot\",\"agentVersion\":\"cynpwlbjnp\"}],\"nextLink\":\"cftadeh\"}")
                .toObject(VMResourcesListResponse.class);
        Assertions.assertEquals("jj", model.value().get(0).id());
        Assertions.assertEquals("v", model.value().get(0).agentVersion());
        Assertions.assertEquals("cftadeh", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VMResourcesListResponse model =
            new VMResourcesListResponse()
                .withValue(
                    Arrays
                        .asList(
                            new VMResourcesInner().withId("jj").withAgentVersion("v"),
                            new VMResourcesInner().withId("dgwdslfhot").withAgentVersion("cynpwlbjnp")))
                .withNextLink("cftadeh");
        model = BinaryData.fromObject(model).toObject(VMResourcesListResponse.class);
        Assertions.assertEquals("jj", model.value().get(0).id());
        Assertions.assertEquals("v", model.value().get(0).agentVersion());
        Assertions.assertEquals("cftadeh", model.nextLink());
    }
}
