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

package com.azure.resourcemanager.newrelicobservability.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleInner;
import com.azure.resourcemanager.newrelicobservability.models.TagRuleListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class TagRuleListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        TagRuleListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"dyjrrfbyaosv\",\"name\":\"xc\",\"type\":\"onpc\"},{\"properties\":{\"provisioningState\":\"Accepted\"},\"id\":\"slkevle\",\"name\":\"gz\",\"type\":\"buhfmvfaxkffeiit\"}],\"nextLink\":\"vmezy\"}")
                .toObject(TagRuleListResult.class);
        Assertions.assertEquals("vmezy", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        TagRuleListResult model =
            new TagRuleListResult()
                .withValue(Arrays.asList(new TagRuleInner(), new TagRuleInner()))
                .withNextLink("vmezy");
        model = BinaryData.fromObject(model).toObject(TagRuleListResult.class);
        Assertions.assertEquals("vmezy", model.nextLink());
    }
}
