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

public final class ResourceProviderOperationListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ResourceProviderOperationList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"zopbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"isDataAction\":false,\"properties\":{}},{\"name\":\"izhwlrxy\",\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"isDataAction\":true,\"properties\":{}},{\"name\":\"esaagdfm\",\"display\":{\"provider\":\"lhjxr\",\"resource\":\"kwm\",\"operation\":\"ktsizntocipaou\",\"description\":\"psqucmpoyf\"},\"isDataAction\":true,\"properties\":{}}],\"nextLink\":\"nygj\"}")
                .toObject(ResourceProviderOperationList.class);
        Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name());
        Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider());
        Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource());
        Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation());
        Assertions.assertEquals("zehtbmu", model.value().get(0).display().description());
        Assertions.assertEquals(false, model.value().get(0).isDataAction());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ResourceProviderOperationList model =
            new ResourceProviderOperationList()
                .withValue(
                    Arrays
                        .asList(
                            new ResourceProviderOperationInner()
                                .withName("quvgjxpybczme")
                                .withDisplay(
                                    new ResourceProviderOperationDisplay()
                                        .withProvider("zopbsphrupidgs")
                                        .withResource("bejhphoycmsxa")
                                        .withOperation("hdxbmtqio")
                                        .withDescription("zehtbmu"))
                                .withIsDataAction(false)
                                .withProperties(new OperationProperties()),
                            new ResourceProviderOperationInner()
                                .withName("izhwlrxy")
                                .withDisplay(
                                    new ResourceProviderOperationDisplay()
                                        .withProvider("oqijgkdmbpaz")
                                        .withResource("bc")
                                        .withOperation("pdznrbtcqqjnqgl")
                                        .withDescription("gnufoooj"))
                                .withIsDataAction(true)
                                .withProperties(new OperationProperties()),
                            new ResourceProviderOperationInner()
                                .withName("esaagdfm")
                                .withDisplay(
                                    new ResourceProviderOperationDisplay()
                                        .withProvider("lhjxr")
                                        .withResource("kwm")
                                        .withOperation("ktsizntocipaou")
                                        .withDescription("psqucmpoyf"))
                                .withIsDataAction(true)
                                .withProperties(new OperationProperties())));
        model = BinaryData.fromObject(model).toObject(ResourceProviderOperationList.class);
        Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name());
        Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider());
        Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource());
        Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation());
        Assertions.assertEquals("zehtbmu", model.value().get(0).display().description());
        Assertions.assertEquals(false, model.value().get(0).isDataAction());
    }
}
