// 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.models.NameDescriptionObject;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServicesTypeList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class SecurityServicesTypeListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SecurityServicesTypeList model =
            BinaryData
                .fromString(
                    "{\"type\":\"zfbuhf\",\"entry\":[{\"name\":\"faxkffeii\",\"description\":\"lvmezyvshxmzsbbz\"},{\"name\":\"ggi\",\"description\":\"xwburvjxxjns\"},{\"name\":\"ydptkoen\",\"description\":\"uknvudwti\"}]}")
                .toObject(SecurityServicesTypeList.class);
        Assertions.assertEquals("zfbuhf", model.type());
        Assertions.assertEquals("faxkffeii", model.entry().get(0).name());
        Assertions.assertEquals("lvmezyvshxmzsbbz", model.entry().get(0).description());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SecurityServicesTypeList model =
            new SecurityServicesTypeList()
                .withType("zfbuhf")
                .withEntry(
                    Arrays
                        .asList(
                            new NameDescriptionObject().withName("faxkffeii").withDescription("lvmezyvshxmzsbbz"),
                            new NameDescriptionObject().withName("ggi").withDescription("xwburvjxxjns"),
                            new NameDescriptionObject().withName("ydptkoen").withDescription("uknvudwti")));
        model = BinaryData.fromObject(model).toObject(SecurityServicesTypeList.class);
        Assertions.assertEquals("zfbuhf", model.type());
        Assertions.assertEquals("faxkffeii", model.entry().get(0).name());
        Assertions.assertEquals("lvmezyvshxmzsbbz", model.entry().get(0).description());
    }
}
