// 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.StartMenuItemInner;
import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItemList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class StartMenuItemListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        StartMenuItemList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"appAlias\":\"g\",\"filePath\":\"dxyt\",\"commandLineArguments\":\"oyrxvwfudwpzntxh\",\"iconPath\":\"hl\",\"iconIndex\":291050041},\"id\":\"bh\",\"name\":\"kfrlhrxsbky\",\"type\":\"pycanuzbpz\"}],\"nextLink\":\"fkuwbcrnwbmehhse\"}")
                .toObject(StartMenuItemList.class);
        Assertions.assertEquals("g", model.value().get(0).appAlias());
        Assertions.assertEquals("dxyt", model.value().get(0).filePath());
        Assertions.assertEquals("oyrxvwfudwpzntxh", model.value().get(0).commandLineArguments());
        Assertions.assertEquals("hl", model.value().get(0).iconPath());
        Assertions.assertEquals(291050041, model.value().get(0).iconIndex());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        StartMenuItemList model =
            new StartMenuItemList()
                .withValue(
                    Arrays
                        .asList(
                            new StartMenuItemInner()
                                .withAppAlias("g")
                                .withFilePath("dxyt")
                                .withCommandLineArguments("oyrxvwfudwpzntxh")
                                .withIconPath("hl")
                                .withIconIndex(291050041)));
        model = BinaryData.fromObject(model).toObject(StartMenuItemList.class);
        Assertions.assertEquals("g", model.value().get(0).appAlias());
        Assertions.assertEquals("dxyt", model.value().get(0).filePath());
        Assertions.assertEquals("oyrxvwfudwpzntxh", model.value().get(0).commandLineArguments());
        Assertions.assertEquals("hl", model.value().get(0).iconPath());
        Assertions.assertEquals(291050041, model.value().get(0).iconIndex());
    }
}
