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

package com.azure.resourcemanager.azurestack.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.azurestack.fluent.models.ProductInner;
import com.azure.resourcemanager.azurestack.fluent.models.ProductListInner;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ProductListInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ProductListInner model =
            BinaryData
                .fromString(
                    "{\"nextLink\":\"fdosyg\",\"value\":[{\"properties\":{\"displayName\":\"jakhmsbzjh\",\"description\":\"zevdphlx\",\"publisherDisplayName\":\"lthqtrgqjbp\",\"publisherIdentifier\":\"fsinzgvfcjrwzoxx\",\"offer\":\"felluwfzitonpe\",\"offerVersion\":\"pjkjlxofpdv\",\"sku\":\"fxxypininmayhuy\",\"billingPartNumber\":\"kpode\",\"vmExtensionType\":\"oginuvamiheognar\",\"galleryItemIdentity\":\"xth\",\"links\":[],\"legalTerms\":\"si\",\"privacyPolicy\":\"evcciqihnhun\",\"payloadLength\":4957035002722095413,\"productKind\":\"rnfygxgispem\"},\"etag\":\"kufubljo\",\"id\":\"xqeofjaeqjhqjba\",\"name\":\"v\",\"type\":\"smjqulngsntnbyb\"},{\"properties\":{\"displayName\":\"cwrwclxxwrljdous\",\"description\":\"qvkoc\",\"publisherDisplayName\":\"jdkwtnhxbnjb\",\"publisherIdentifier\":\"sqrglssainq\",\"offer\":\"wnzlljfmppeeb\",\"offerVersion\":\"gxsabkyq\",\"sku\":\"ujitcjcz\",\"billingPartNumber\":\"evndh\",\"vmExtensionType\":\"wpdappdsbdkv\",\"galleryItemIdentity\":\"wjfeusnhutjel\",\"links\":[],\"legalTerms\":\"dhugjzzdatqxhocd\",\"privacyPolicy\":\"ablgphuticndvk\",\"payloadLength\":3855814932873263395,\"productKind\":\"i\"},\"etag\":\"xhurok\",\"id\":\"tyxolniwpwc\",\"name\":\"kjfkg\",\"type\":\"awxklr\"},{\"properties\":{\"displayName\":\"wckbasyypnd\",\"description\":\"sgcbac\",\"publisherDisplayName\":\"ejk\",\"publisherIdentifier\":\"ynqgoulzndlikwyq\",\"offer\":\"fgibmadgakeq\",\"offerVersion\":\"xybz\",\"sku\":\"e\",\"billingPartNumber\":\"ytb\",\"vmExtensionType\":\"qfou\",\"galleryItemIdentity\":\"mmnkzsmodmgl\",\"links\":[],\"legalTerms\":\"b\",\"privacyPolicy\":\"tmut\",\"payloadLength\":6791245168760921205,\"productKind\":\"ap\"},\"etag\":\"cuertu\",\"id\":\"kdosvqw\",\"name\":\"bmdg\",\"type\":\"bjf\"},{\"properties\":{\"displayName\":\"mbmbexppbh\",\"description\":\"qrolfpf\",\"publisherDisplayName\":\"algbquxigjyjg\",\"publisherIdentifier\":\"aoyfhrtxilnerkuj\",\"offer\":\"vlejuvfqa\",\"offerVersion\":\"lyxwjkcprbnwbx\",\"sku\":\"vtb\",\"billingPartNumber\":\"ysszdnrujqguh\",\"vmExtensionType\":\"ouqfprwz\",\"galleryItemIdentity\":\"nguitnwuizgazxu\",\"links\":[],\"legalTerms\":\"ckyfih\",\"privacyPolicy\":\"idf\",\"payloadLength\":4350279540682029600,\"productKind\":\"uht\"},\"etag\":\"sdkf\",\"id\":\"hwxmnteiwa\",\"name\":\"pvkmijcmmxdcuf\",\"type\":\"fsrpymzidnse\"}]}")
                .toObject(ProductListInner.class);
        Assertions.assertEquals("fdosyg", model.nextLink());
        Assertions.assertEquals("kufubljo", model.value().get(0).etag());
        Assertions.assertEquals("jakhmsbzjh", model.value().get(0).displayName());
        Assertions.assertEquals("zevdphlx", model.value().get(0).description());
        Assertions.assertEquals("lthqtrgqjbp", model.value().get(0).publisherDisplayName());
        Assertions.assertEquals("fsinzgvfcjrwzoxx", model.value().get(0).publisherIdentifier());
        Assertions.assertEquals("felluwfzitonpe", model.value().get(0).offer());
        Assertions.assertEquals("pjkjlxofpdv", model.value().get(0).offerVersion());
        Assertions.assertEquals("fxxypininmayhuy", model.value().get(0).sku());
        Assertions.assertEquals("kpode", model.value().get(0).billingPartNumber());
        Assertions.assertEquals("oginuvamiheognar", model.value().get(0).vmExtensionType());
        Assertions.assertEquals("xth", model.value().get(0).galleryItemIdentity());
        Assertions.assertEquals("si", model.value().get(0).legalTerms());
        Assertions.assertEquals("evcciqihnhun", model.value().get(0).privacyPolicy());
        Assertions.assertEquals(4957035002722095413L, model.value().get(0).payloadLength());
        Assertions.assertEquals("rnfygxgispem", model.value().get(0).productKind());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ProductListInner model =
            new ProductListInner()
                .withNextLink("fdosyg")
                .withValue(
                    Arrays
                        .asList(
                            new ProductInner()
                                .withEtag("kufubljo")
                                .withDisplayName("jakhmsbzjh")
                                .withDescription("zevdphlx")
                                .withPublisherDisplayName("lthqtrgqjbp")
                                .withPublisherIdentifier("fsinzgvfcjrwzoxx")
                                .withOffer("felluwfzitonpe")
                                .withOfferVersion("pjkjlxofpdv")
                                .withSku("fxxypininmayhuy")
                                .withBillingPartNumber("kpode")
                                .withVmExtensionType("oginuvamiheognar")
                                .withGalleryItemIdentity("xth")
                                .withLinks(Arrays.asList())
                                .withLegalTerms("si")
                                .withPrivacyPolicy("evcciqihnhun")
                                .withPayloadLength(4957035002722095413L)
                                .withProductKind("rnfygxgispem"),
                            new ProductInner()
                                .withEtag("xhurok")
                                .withDisplayName("cwrwclxxwrljdous")
                                .withDescription("qvkoc")
                                .withPublisherDisplayName("jdkwtnhxbnjb")
                                .withPublisherIdentifier("sqrglssainq")
                                .withOffer("wnzlljfmppeeb")
                                .withOfferVersion("gxsabkyq")
                                .withSku("ujitcjcz")
                                .withBillingPartNumber("evndh")
                                .withVmExtensionType("wpdappdsbdkv")
                                .withGalleryItemIdentity("wjfeusnhutjel")
                                .withLinks(Arrays.asList())
                                .withLegalTerms("dhugjzzdatqxhocd")
                                .withPrivacyPolicy("ablgphuticndvk")
                                .withPayloadLength(3855814932873263395L)
                                .withProductKind("i"),
                            new ProductInner()
                                .withEtag("cuertu")
                                .withDisplayName("wckbasyypnd")
                                .withDescription("sgcbac")
                                .withPublisherDisplayName("ejk")
                                .withPublisherIdentifier("ynqgoulzndlikwyq")
                                .withOffer("fgibmadgakeq")
                                .withOfferVersion("xybz")
                                .withSku("e")
                                .withBillingPartNumber("ytb")
                                .withVmExtensionType("qfou")
                                .withGalleryItemIdentity("mmnkzsmodmgl")
                                .withLinks(Arrays.asList())
                                .withLegalTerms("b")
                                .withPrivacyPolicy("tmut")
                                .withPayloadLength(6791245168760921205L)
                                .withProductKind("ap"),
                            new ProductInner()
                                .withEtag("sdkf")
                                .withDisplayName("mbmbexppbh")
                                .withDescription("qrolfpf")
                                .withPublisherDisplayName("algbquxigjyjg")
                                .withPublisherIdentifier("aoyfhrtxilnerkuj")
                                .withOffer("vlejuvfqa")
                                .withOfferVersion("lyxwjkcprbnwbx")
                                .withSku("vtb")
                                .withBillingPartNumber("ysszdnrujqguh")
                                .withVmExtensionType("ouqfprwz")
                                .withGalleryItemIdentity("nguitnwuizgazxu")
                                .withLinks(Arrays.asList())
                                .withLegalTerms("ckyfih")
                                .withPrivacyPolicy("idf")
                                .withPayloadLength(4350279540682029600L)
                                .withProductKind("uht")));
        model = BinaryData.fromObject(model).toObject(ProductListInner.class);
        Assertions.assertEquals("fdosyg", model.nextLink());
        Assertions.assertEquals("kufubljo", model.value().get(0).etag());
        Assertions.assertEquals("jakhmsbzjh", model.value().get(0).displayName());
        Assertions.assertEquals("zevdphlx", model.value().get(0).description());
        Assertions.assertEquals("lthqtrgqjbp", model.value().get(0).publisherDisplayName());
        Assertions.assertEquals("fsinzgvfcjrwzoxx", model.value().get(0).publisherIdentifier());
        Assertions.assertEquals("felluwfzitonpe", model.value().get(0).offer());
        Assertions.assertEquals("pjkjlxofpdv", model.value().get(0).offerVersion());
        Assertions.assertEquals("fxxypininmayhuy", model.value().get(0).sku());
        Assertions.assertEquals("kpode", model.value().get(0).billingPartNumber());
        Assertions.assertEquals("oginuvamiheognar", model.value().get(0).vmExtensionType());
        Assertions.assertEquals("xth", model.value().get(0).galleryItemIdentity());
        Assertions.assertEquals("si", model.value().get(0).legalTerms());
        Assertions.assertEquals("evcciqihnhun", model.value().get(0).privacyPolicy());
        Assertions.assertEquals(4957035002722095413L, model.value().get(0).payloadLength());
        Assertions.assertEquals("rnfygxgispem", model.value().get(0).productKind());
    }
}
