// 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.ApplicationInner;
import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting;
import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType;
import org.junit.jupiter.api.Assertions;

public final class ApplicationInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ApplicationInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"objectId\":\"shsfwxosowzxcu\",\"description\":\"cjooxdjebwpucwwf\",\"friendlyName\":\"vbvmeu\",\"filePath\":\"ivyhzceuojgjrwju\",\"msixPackageFamilyName\":\"otwmcdyt\",\"msixPackageApplicationId\":\"wit\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"wgqwgxhn\",\"showInPortal\":true,\"iconPath\":\"fbkp\",\"iconIndex\":1098465372,\"iconHash\":\"lwn\"},\"id\":\"hjdauwhvylwz\",\"name\":\"tdhxujznbmpowuwp\",\"type\":\"zqlveualupjmkhf\"}")
                .toObject(ApplicationInner.class);
        Assertions.assertEquals("cjooxdjebwpucwwf", model.description());
        Assertions.assertEquals("vbvmeu", model.friendlyName());
        Assertions.assertEquals("ivyhzceuojgjrwju", model.filePath());
        Assertions.assertEquals("otwmcdyt", model.msixPackageFamilyName());
        Assertions.assertEquals("wit", model.msixPackageApplicationId());
        Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType());
        Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting());
        Assertions.assertEquals("wgqwgxhn", model.commandLineArguments());
        Assertions.assertEquals(true, model.showInPortal());
        Assertions.assertEquals("fbkp", model.iconPath());
        Assertions.assertEquals(1098465372, model.iconIndex());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ApplicationInner model =
            new ApplicationInner()
                .withDescription("cjooxdjebwpucwwf")
                .withFriendlyName("vbvmeu")
                .withFilePath("ivyhzceuojgjrwju")
                .withMsixPackageFamilyName("otwmcdyt")
                .withMsixPackageApplicationId("wit")
                .withApplicationType(RemoteApplicationType.IN_BUILT)
                .withCommandLineSetting(CommandLineSetting.ALLOW)
                .withCommandLineArguments("wgqwgxhn")
                .withShowInPortal(true)
                .withIconPath("fbkp")
                .withIconIndex(1098465372);
        model = BinaryData.fromObject(model).toObject(ApplicationInner.class);
        Assertions.assertEquals("cjooxdjebwpucwwf", model.description());
        Assertions.assertEquals("vbvmeu", model.friendlyName());
        Assertions.assertEquals("ivyhzceuojgjrwju", model.filePath());
        Assertions.assertEquals("otwmcdyt", model.msixPackageFamilyName());
        Assertions.assertEquals("wit", model.msixPackageApplicationId());
        Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType());
        Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting());
        Assertions.assertEquals("wgqwgxhn", model.commandLineArguments());
        Assertions.assertEquals(true, model.showInPortal());
        Assertions.assertEquals("fbkp", model.iconPath());
        Assertions.assertEquals(1098465372, model.iconIndex());
    }
}
