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

package com.azure.resourcemanager.desktopvirtualization.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner;
import com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImageList;
import java.time.OffsetDateTime;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ExpandMsixImageListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ExpandMsixImageList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"packageAlias\":\"dbodacizsjqlhkrr\",\"imagePath\":\"deibqip\",\"packageName\":\"ghvxndzwmkrefa\",\"packageFamilyName\":\"jorwkqnyhgbij\",\"packageFullName\":\"ivfxzsjabibsyst\",\"displayName\":\"fsdjpvkvp\",\"packageRelativePath\":\"xbkzbzkdvncj\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[],\"version\":\"kakmokzh\",\"lastUpdated\":\"2021-06-24T09:54:49Z\",\"packageApplications\":[]},\"id\":\"ffhmouwqlgzr\",\"name\":\"zeeyebi\",\"type\":\"ikayuhqlbjbsybb\"},{\"properties\":{\"packageAlias\":\"vtldgmfpgvmpip\",\"imagePath\":\"ltha\",\"packageName\":\"x\",\"packageFamilyName\":\"mwutwbdsre\",\"packageFullName\":\"drhneuyow\",\"displayName\":\"d\",\"packageRelativePath\":\"t\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[],\"version\":\"gpikpzimejza\",\"lastUpdated\":\"2021-08-16T12:50:07Z\",\"packageApplications\":[]},\"id\":\"xi\",\"name\":\"vrmbzono\",\"type\":\"i\"}],\"nextLink\":\"jq\"}")
                .toObject(ExpandMsixImageList.class);
        Assertions.assertEquals("dbodacizsjqlhkrr", model.value().get(0).packageAlias());
        Assertions.assertEquals("deibqip", model.value().get(0).imagePath());
        Assertions.assertEquals("ghvxndzwmkrefa", model.value().get(0).packageName());
        Assertions.assertEquals("jorwkqnyhgbij", model.value().get(0).packageFamilyName());
        Assertions.assertEquals("ivfxzsjabibsyst", model.value().get(0).packageFullName());
        Assertions.assertEquals("fsdjpvkvp", model.value().get(0).displayName());
        Assertions.assertEquals("xbkzbzkdvncj", model.value().get(0).packageRelativePath());
        Assertions.assertEquals(true, model.value().get(0).isRegularRegistration());
        Assertions.assertEquals(true, model.value().get(0).isActive());
        Assertions.assertEquals("kakmokzh", model.value().get(0).version());
        Assertions.assertEquals(OffsetDateTime.parse("2021-06-24T09:54:49Z"), model.value().get(0).lastUpdated());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ExpandMsixImageList model =
            new ExpandMsixImageList()
                .withValue(
                    Arrays
                        .asList(
                            new ExpandMsixImageInner()
                                .withPackageAlias("dbodacizsjqlhkrr")
                                .withImagePath("deibqip")
                                .withPackageName("ghvxndzwmkrefa")
                                .withPackageFamilyName("jorwkqnyhgbij")
                                .withPackageFullName("ivfxzsjabibsyst")
                                .withDisplayName("fsdjpvkvp")
                                .withPackageRelativePath("xbkzbzkdvncj")
                                .withIsRegularRegistration(true)
                                .withIsActive(true)
                                .withPackageDependencies(Arrays.asList())
                                .withVersion("kakmokzh")
                                .withLastUpdated(OffsetDateTime.parse("2021-06-24T09:54:49Z"))
                                .withPackageApplications(Arrays.asList()),
                            new ExpandMsixImageInner()
                                .withPackageAlias("vtldgmfpgvmpip")
                                .withImagePath("ltha")
                                .withPackageName("x")
                                .withPackageFamilyName("mwutwbdsre")
                                .withPackageFullName("drhneuyow")
                                .withDisplayName("d")
                                .withPackageRelativePath("t")
                                .withIsRegularRegistration(false)
                                .withIsActive(true)
                                .withPackageDependencies(Arrays.asList())
                                .withVersion("gpikpzimejza")
                                .withLastUpdated(OffsetDateTime.parse("2021-08-16T12:50:07Z"))
                                .withPackageApplications(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(ExpandMsixImageList.class);
        Assertions.assertEquals("dbodacizsjqlhkrr", model.value().get(0).packageAlias());
        Assertions.assertEquals("deibqip", model.value().get(0).imagePath());
        Assertions.assertEquals("ghvxndzwmkrefa", model.value().get(0).packageName());
        Assertions.assertEquals("jorwkqnyhgbij", model.value().get(0).packageFamilyName());
        Assertions.assertEquals("ivfxzsjabibsyst", model.value().get(0).packageFullName());
        Assertions.assertEquals("fsdjpvkvp", model.value().get(0).displayName());
        Assertions.assertEquals("xbkzbzkdvncj", model.value().get(0).packageRelativePath());
        Assertions.assertEquals(true, model.value().get(0).isRegularRegistration());
        Assertions.assertEquals(true, model.value().get(0).isActive());
        Assertions.assertEquals("kakmokzh", model.value().get(0).version());
        Assertions.assertEquals(OffsetDateTime.parse("2021-06-24T09:54:49Z"), model.value().get(0).lastUpdated());
    }
}
