// 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.MonitoredResourceInner;
import org.junit.jupiter.api.Assertions;

public final class MonitoredResourceInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MonitoredResourceInner model =
            BinaryData
                .fromString(
                    "{\"id\":\"uvfqawrlyxwj\",\"sendingMetrics\":true,\"reasonForMetricsStatus\":\"bnwbxgjvtbvpyssz\",\"sendingLogs\":false,\"reasonForLogsStatus\":\"jq\"}")
                .toObject(MonitoredResourceInner.class);
        Assertions.assertEquals("uvfqawrlyxwj", model.id());
        Assertions.assertEquals(true, model.sendingMetrics());
        Assertions.assertEquals("bnwbxgjvtbvpyssz", model.reasonForMetricsStatus());
        Assertions.assertEquals(false, model.sendingLogs());
        Assertions.assertEquals("jq", model.reasonForLogsStatus());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MonitoredResourceInner model =
            new MonitoredResourceInner()
                .withId("uvfqawrlyxwj")
                .withSendingMetrics(true)
                .withReasonForMetricsStatus("bnwbxgjvtbvpyssz")
                .withSendingLogs(false)
                .withReasonForLogsStatus("jq");
        model = BinaryData.fromObject(model).toObject(MonitoredResourceInner.class);
        Assertions.assertEquals("uvfqawrlyxwj", model.id());
        Assertions.assertEquals(true, model.sendingMetrics());
        Assertions.assertEquals("bnwbxgjvtbvpyssz", model.reasonForMetricsStatus());
        Assertions.assertEquals(false, model.sendingLogs());
        Assertions.assertEquals("jq", model.reasonForLogsStatus());
    }
}
