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

package com.azure.resourcemanager.elastic.generated;

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

public final class VMHostListResponseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VMHostListResponse model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"vmResourceId\":\"j\"},{\"vmResourceId\":\"ejctbzaqsqsycb\"}],\"nextLink\":\"fkgukdkexxppof\"}")
                .toObject(VMHostListResponse.class);
        Assertions.assertEquals("j", model.value().get(0).vmResourceId());
        Assertions.assertEquals("fkgukdkexxppof", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VMHostListResponse model =
            new VMHostListResponse()
                .withValue(
                    Arrays
                        .asList(
                            new VMResourcesInner().withVmResourceId("j"),
                            new VMResourcesInner().withVmResourceId("ejctbzaqsqsycb")))
                .withNextLink("fkgukdkexxppof");
        model = BinaryData.fromObject(model).toObject(VMHostListResponse.class);
        Assertions.assertEquals("j", model.value().get(0).vmResourceId());
        Assertions.assertEquals("fkgukdkexxppof", model.nextLink());
    }
}
