// 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.MonitoredResourceInner;
import com.azure.resourcemanager.elastic.models.MonitoredResourceListResponse;
import com.azure.resourcemanager.elastic.models.SendingLogs;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class MonitoredResourceListResponseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MonitoredResourceListResponse model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"id\":\"fpfpsalgbquxigj\",\"sendingLogs\":\"False\",\"reasonForLogsStatus\":\"jaoyfhrtx\"}],\"nextLink\":\"n\"}")
                .toObject(MonitoredResourceListResponse.class);
        Assertions.assertEquals("fpfpsalgbquxigj", model.value().get(0).id());
        Assertions.assertEquals(SendingLogs.FALSE, model.value().get(0).sendingLogs());
        Assertions.assertEquals("jaoyfhrtx", model.value().get(0).reasonForLogsStatus());
        Assertions.assertEquals("n", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MonitoredResourceListResponse model =
            new MonitoredResourceListResponse()
                .withValue(
                    Arrays
                        .asList(
                            new MonitoredResourceInner()
                                .withId("fpfpsalgbquxigj")
                                .withSendingLogs(SendingLogs.FALSE)
                                .withReasonForLogsStatus("jaoyfhrtx")))
                .withNextLink("n");
        model = BinaryData.fromObject(model).toObject(MonitoredResourceListResponse.class);
        Assertions.assertEquals("fpfpsalgbquxigj", model.value().get(0).id());
        Assertions.assertEquals(SendingLogs.FALSE, model.value().get(0).sendingLogs());
        Assertions.assertEquals("jaoyfhrtx", model.value().get(0).reasonForLogsStatus());
        Assertions.assertEquals("n", model.nextLink());
    }
}
