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

package com.azure.resourcemanager.resourcemover.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.resourcemover.fluent.models.OperationsDiscoveryCollectionInner;
import com.azure.resourcemanager.resourcemover.models.Display;
import com.azure.resourcemanager.resourcemover.models.OperationsDiscovery;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class OperationsDiscoveryCollectionInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OperationsDiscoveryCollectionInner model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"name\":\"z\",\"isDataAction\":true,\"display\":{\"provider\":\"pgvdf\",\"resource\":\"otkftutqxlngx\",\"operation\":\"fgugnxkrxdqmid\",\"description\":\"hzrvqd\"},\"origin\":\"bhj\",\"properties\":\"dataigeho\"},{\"name\":\"bowsk\",\"isDataAction\":false,\"display\":{\"provider\":\"zlcuiywgqywgndrv\",\"resource\":\"hzgpphrcgyncocpe\",\"operation\":\"vmmcoofs\",\"description\":\"zevgb\"},\"origin\":\"jqabcypmivkwlzuv\",\"properties\":\"datafwnfnb\"},{\"name\":\"fionl\",\"isDataAction\":false,\"display\":{\"provider\":\"qgtz\",\"resource\":\"pnqbqqwxrjfe\",\"operation\":\"lnwsubisn\",\"description\":\"mpmngnzscxaqwoo\"},\"origin\":\"cbonqvpk\",\"properties\":\"datarxnjeaseipheofl\"},{\"name\":\"eyy\",\"isDataAction\":false,\"display\":{\"provider\":\"dlwtgrhpdj\",\"resource\":\"umasxazjpq\",\"operation\":\"gual\",\"description\":\"xxhejjzzvd\"},\"origin\":\"gwdslfhotwm\",\"properties\":\"datanpwlbjnpg\"}],\"nextLink\":\"ftadehxnltyfs\"}")
                .toObject(OperationsDiscoveryCollectionInner.class);
        Assertions.assertEquals("z", model.value().get(0).name());
        Assertions.assertEquals(true, model.value().get(0).isDataAction());
        Assertions.assertEquals("pgvdf", model.value().get(0).display().provider());
        Assertions.assertEquals("otkftutqxlngx", model.value().get(0).display().resource());
        Assertions.assertEquals("fgugnxkrxdqmid", model.value().get(0).display().operation());
        Assertions.assertEquals("hzrvqd", model.value().get(0).display().description());
        Assertions.assertEquals("bhj", model.value().get(0).origin());
        Assertions.assertEquals("ftadehxnltyfs", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationsDiscoveryCollectionInner model =
            new OperationsDiscoveryCollectionInner()
                .withValue(
                    Arrays
                        .asList(
                            new OperationsDiscovery()
                                .withName("z")
                                .withIsDataAction(true)
                                .withDisplay(
                                    new Display()
                                        .withProvider("pgvdf")
                                        .withResource("otkftutqxlngx")
                                        .withOperation("fgugnxkrxdqmid")
                                        .withDescription("hzrvqd"))
                                .withOrigin("bhj")
                                .withProperties("dataigeho"),
                            new OperationsDiscovery()
                                .withName("bowsk")
                                .withIsDataAction(false)
                                .withDisplay(
                                    new Display()
                                        .withProvider("zlcuiywgqywgndrv")
                                        .withResource("hzgpphrcgyncocpe")
                                        .withOperation("vmmcoofs")
                                        .withDescription("zevgb"))
                                .withOrigin("jqabcypmivkwlzuv")
                                .withProperties("datafwnfnb"),
                            new OperationsDiscovery()
                                .withName("fionl")
                                .withIsDataAction(false)
                                .withDisplay(
                                    new Display()
                                        .withProvider("qgtz")
                                        .withResource("pnqbqqwxrjfe")
                                        .withOperation("lnwsubisn")
                                        .withDescription("mpmngnzscxaqwoo"))
                                .withOrigin("cbonqvpk")
                                .withProperties("datarxnjeaseipheofl"),
                            new OperationsDiscovery()
                                .withName("eyy")
                                .withIsDataAction(false)
                                .withDisplay(
                                    new Display()
                                        .withProvider("dlwtgrhpdj")
                                        .withResource("umasxazjpq")
                                        .withOperation("gual")
                                        .withDescription("xxhejjzzvd"))
                                .withOrigin("gwdslfhotwm")
                                .withProperties("datanpwlbjnpg")))
                .withNextLink("ftadehxnltyfs");
        model = BinaryData.fromObject(model).toObject(OperationsDiscoveryCollectionInner.class);
        Assertions.assertEquals("z", model.value().get(0).name());
        Assertions.assertEquals(true, model.value().get(0).isDataAction());
        Assertions.assertEquals("pgvdf", model.value().get(0).display().provider());
        Assertions.assertEquals("otkftutqxlngx", model.value().get(0).display().resource());
        Assertions.assertEquals("fgugnxkrxdqmid", model.value().get(0).display().operation());
        Assertions.assertEquals("hzrvqd", model.value().get(0).display().description());
        Assertions.assertEquals("bhj", model.value().get(0).origin());
        Assertions.assertEquals("ftadehxnltyfs", model.nextLink());
    }
}
