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

package com.azure.resourcemanager.hybridcontainerservice.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hybridcontainerservice.fluent.models.ResourceProviderOperationInner;
import com.azure.resourcemanager.hybridcontainerservice.models.ResourceProviderOperationDisplay;
import com.azure.resourcemanager.hybridcontainerservice.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\":[{\"isDataAction\":\"dgfbcvkcvqvpke\",\"name\":\"cvdrhvoodsot\",\"display\":{\"provider\":\"zdopcjwvnhd\",\"resource\":\"wmgxcxrsl\",\"operation\":\"utwu\",\"description\":\"grpkhjwniyqs\"}},{\"isDataAction\":\"i\",\"name\":\"dggkzzlvmbmpa\",\"display\":{\"provider\":\"dfvue\",\"resource\":\"wsbpfvm\",\"operation\":\"hrfou\",\"description\":\"taakc\"}}],\"nextLink\":\"iyzvqtmnub\"}")
                .toObject(ResourceProviderOperationList.class);
        Assertions.assertEquals("dgfbcvkcvqvpke", model.value().get(0).isDataAction());
        Assertions.assertEquals("cvdrhvoodsot", model.value().get(0).name());
        Assertions.assertEquals("zdopcjwvnhd", model.value().get(0).display().provider());
        Assertions.assertEquals("wmgxcxrsl", model.value().get(0).display().resource());
        Assertions.assertEquals("utwu", model.value().get(0).display().operation());
        Assertions.assertEquals("grpkhjwniyqs", model.value().get(0).display().description());
        Assertions.assertEquals("iyzvqtmnub", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ResourceProviderOperationList model =
            new ResourceProviderOperationList()
                .withValue(
                    Arrays
                        .asList(
                            new ResourceProviderOperationInner()
                                .withIsDataAction("dgfbcvkcvqvpke")
                                .withName("cvdrhvoodsot")
                                .withDisplay(
                                    new ResourceProviderOperationDisplay()
                                        .withProvider("zdopcjwvnhd")
                                        .withResource("wmgxcxrsl")
                                        .withOperation("utwu")
                                        .withDescription("grpkhjwniyqs")),
                            new ResourceProviderOperationInner()
                                .withIsDataAction("i")
                                .withName("dggkzzlvmbmpa")
                                .withDisplay(
                                    new ResourceProviderOperationDisplay()
                                        .withProvider("dfvue")
                                        .withResource("wsbpfvm")
                                        .withOperation("hrfou")
                                        .withDescription("taakc"))))
                .withNextLink("iyzvqtmnub");
        model = BinaryData.fromObject(model).toObject(ResourceProviderOperationList.class);
        Assertions.assertEquals("dgfbcvkcvqvpke", model.value().get(0).isDataAction());
        Assertions.assertEquals("cvdrhvoodsot", model.value().get(0).name());
        Assertions.assertEquals("zdopcjwvnhd", model.value().get(0).display().provider());
        Assertions.assertEquals("wmgxcxrsl", model.value().get(0).display().resource());
        Assertions.assertEquals("utwu", model.value().get(0).display().operation());
        Assertions.assertEquals("grpkhjwniyqs", model.value().get(0).display().description());
        Assertions.assertEquals("iyzvqtmnub", model.nextLink());
    }
}
