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

package com.azure.resourcemanager.paloaltonetworks.ngfw.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FqdnListLocalRulestackResourceInner;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.FqdnListLocalRulestackResourceListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class FqdnListLocalRulestackResourceListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        FqdnListLocalRulestackResourceListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"description\":\"b\",\"fqdnList\":[],\"etag\":\"xlllchp\",\"auditComment\":\"bzevwrd\",\"provisioningState\":\"Deleted\"},\"id\":\"kuvsjcswsm\",\"name\":\"stul\",\"type\":\"qypfcv\"},{\"properties\":{\"description\":\"rchpqbmfpjbabwid\",\"fqdnList\":[],\"etag\":\"xsspuunnoxyhk\",\"auditComment\":\"qddrihpfhoqcaae\",\"provisioningState\":\"Updating\"},\"id\":\"mdjvlpj\",\"name\":\"xkzb\",\"type\":\"msgeivsiykzk\"}],\"nextLink\":\"cjdx\"}")
                .toObject(FqdnListLocalRulestackResourceListResult.class);
        Assertions.assertEquals("b", model.value().get(0).description());
        Assertions.assertEquals("xlllchp", model.value().get(0).etag());
        Assertions.assertEquals("bzevwrd", model.value().get(0).auditComment());
        Assertions.assertEquals("cjdx", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        FqdnListLocalRulestackResourceListResult model =
            new FqdnListLocalRulestackResourceListResult()
                .withValue(
                    Arrays
                        .asList(
                            new FqdnListLocalRulestackResourceInner()
                                .withDescription("b")
                                .withFqdnList(Arrays.asList())
                                .withEtag("xlllchp")
                                .withAuditComment("bzevwrd"),
                            new FqdnListLocalRulestackResourceInner()
                                .withDescription("rchpqbmfpjbabwid")
                                .withFqdnList(Arrays.asList())
                                .withEtag("xsspuunnoxyhk")
                                .withAuditComment("qddrihpfhoqcaae")))
                .withNextLink("cjdx");
        model = BinaryData.fromObject(model).toObject(FqdnListLocalRulestackResourceListResult.class);
        Assertions.assertEquals("b", model.value().get(0).description());
        Assertions.assertEquals("xlllchp", model.value().get(0).etag());
        Assertions.assertEquals("bzevwrd", model.value().get(0).auditComment());
        Assertions.assertEquals("cjdx", model.nextLink());
    }
}
