// 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.ExpandMsixImageProperties;
import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications;
import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies;
import java.time.OffsetDateTime;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ExpandMsixImagePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ExpandMsixImageProperties model =
            BinaryData
                .fromString(
                    "{\"packageAlias\":\"fiibfggjioolvr\",\"imagePath\":\"kvtkkg\",\"packageName\":\"qwjygvja\",\"packageFamilyName\":\"blmhvkzuhb\",\"packageFullName\":\"vyhgs\",\"displayName\":\"byrqufeg\",\"packageRelativePath\":\"vwz\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"l\",\"publisher\":\"ngitvgbmhrixkwm\",\"minVersion\":\"jejveg\"},{\"dependencyName\":\"bpnaixexccbdre\",\"publisher\":\"hcexdrrvqa\",\"minVersion\":\"kghtpwijnh\"},{\"dependencyName\":\"svfycxzbfv\",\"publisher\":\"wvrvmtg\",\"minVersion\":\"ppyostronzmyhgf\"}],\"version\":\"nsxkmcwaekrrjr\",\"lastUpdated\":\"2021-03-26T11:48:46Z\",\"packageApplications\":[{\"appId\":\"gumhjglikkxws\",\"description\":\"lbqpvuzlmvfelf\",\"appUserModelID\":\"gplcrpwjxeznoigb\",\"friendlyName\":\"jwmwkpnbs\",\"iconImageName\":\"ejjoqkagfhsxtta\"},{\"appId\":\"nfaazpxdtnkdmkq\",\"description\":\"lwuenvrkp\",\"appUserModelID\":\"uaibrebqaaysj\",\"friendlyName\":\"xqtnq\",\"iconImageName\":\"ezl\"}]}")
                .toObject(ExpandMsixImageProperties.class);
        Assertions.assertEquals("fiibfggjioolvr", model.packageAlias());
        Assertions.assertEquals("kvtkkg", model.imagePath());
        Assertions.assertEquals("qwjygvja", model.packageName());
        Assertions.assertEquals("blmhvkzuhb", model.packageFamilyName());
        Assertions.assertEquals("vyhgs", model.packageFullName());
        Assertions.assertEquals("byrqufeg", model.displayName());
        Assertions.assertEquals("vwz", model.packageRelativePath());
        Assertions.assertEquals(true, model.isRegularRegistration());
        Assertions.assertEquals(false, model.isActive());
        Assertions.assertEquals("l", model.packageDependencies().get(0).dependencyName());
        Assertions.assertEquals("ngitvgbmhrixkwm", model.packageDependencies().get(0).publisher());
        Assertions.assertEquals("jejveg", model.packageDependencies().get(0).minVersion());
        Assertions.assertEquals("nsxkmcwaekrrjr", model.version());
        Assertions.assertEquals(OffsetDateTime.parse("2021-03-26T11:48:46Z"), model.lastUpdated());
        Assertions.assertEquals("gumhjglikkxws", model.packageApplications().get(0).appId());
        Assertions.assertEquals("lbqpvuzlmvfelf", model.packageApplications().get(0).description());
        Assertions.assertEquals("gplcrpwjxeznoigb", model.packageApplications().get(0).appUserModelId());
        Assertions.assertEquals("jwmwkpnbs", model.packageApplications().get(0).friendlyName());
        Assertions.assertEquals("ejjoqkagfhsxtta", model.packageApplications().get(0).iconImageName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ExpandMsixImageProperties model =
            new ExpandMsixImageProperties()
                .withPackageAlias("fiibfggjioolvr")
                .withImagePath("kvtkkg")
                .withPackageName("qwjygvja")
                .withPackageFamilyName("blmhvkzuhb")
                .withPackageFullName("vyhgs")
                .withDisplayName("byrqufeg")
                .withPackageRelativePath("vwz")
                .withIsRegularRegistration(true)
                .withIsActive(false)
                .withPackageDependencies(
                    Arrays
                        .asList(
                            new MsixPackageDependencies()
                                .withDependencyName("l")
                                .withPublisher("ngitvgbmhrixkwm")
                                .withMinVersion("jejveg"),
                            new MsixPackageDependencies()
                                .withDependencyName("bpnaixexccbdre")
                                .withPublisher("hcexdrrvqa")
                                .withMinVersion("kghtpwijnh"),
                            new MsixPackageDependencies()
                                .withDependencyName("svfycxzbfv")
                                .withPublisher("wvrvmtg")
                                .withMinVersion("ppyostronzmyhgf")))
                .withVersion("nsxkmcwaekrrjr")
                .withLastUpdated(OffsetDateTime.parse("2021-03-26T11:48:46Z"))
                .withPackageApplications(
                    Arrays
                        .asList(
                            new MsixPackageApplications()
                                .withAppId("gumhjglikkxws")
                                .withDescription("lbqpvuzlmvfelf")
                                .withAppUserModelId("gplcrpwjxeznoigb")
                                .withFriendlyName("jwmwkpnbs")
                                .withIconImageName("ejjoqkagfhsxtta"),
                            new MsixPackageApplications()
                                .withAppId("nfaazpxdtnkdmkq")
                                .withDescription("lwuenvrkp")
                                .withAppUserModelId("uaibrebqaaysj")
                                .withFriendlyName("xqtnq")
                                .withIconImageName("ezl")));
        model = BinaryData.fromObject(model).toObject(ExpandMsixImageProperties.class);
        Assertions.assertEquals("fiibfggjioolvr", model.packageAlias());
        Assertions.assertEquals("kvtkkg", model.imagePath());
        Assertions.assertEquals("qwjygvja", model.packageName());
        Assertions.assertEquals("blmhvkzuhb", model.packageFamilyName());
        Assertions.assertEquals("vyhgs", model.packageFullName());
        Assertions.assertEquals("byrqufeg", model.displayName());
        Assertions.assertEquals("vwz", model.packageRelativePath());
        Assertions.assertEquals(true, model.isRegularRegistration());
        Assertions.assertEquals(false, model.isActive());
        Assertions.assertEquals("l", model.packageDependencies().get(0).dependencyName());
        Assertions.assertEquals("ngitvgbmhrixkwm", model.packageDependencies().get(0).publisher());
        Assertions.assertEquals("jejveg", model.packageDependencies().get(0).minVersion());
        Assertions.assertEquals("nsxkmcwaekrrjr", model.version());
        Assertions.assertEquals(OffsetDateTime.parse("2021-03-26T11:48:46Z"), model.lastUpdated());
        Assertions.assertEquals("gumhjglikkxws", model.packageApplications().get(0).appId());
        Assertions.assertEquals("lbqpvuzlmvfelf", model.packageApplications().get(0).description());
        Assertions.assertEquals("gplcrpwjxeznoigb", model.packageApplications().get(0).appUserModelId());
        Assertions.assertEquals("jwmwkpnbs", model.packageApplications().get(0).friendlyName());
        Assertions.assertEquals("ejjoqkagfhsxtta", model.packageApplications().get(0).iconImageName());
    }
}
