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

package com.azure.resourcemanager.elasticsan.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner;
import com.azure.resourcemanager.elasticsan.models.ElasticSanOperationListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class ElasticSanOperationListResultTests {
    @Test
    public void testDeserialize() {
        ElasticSanOperationListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"name\":\"mhquvgjxp\",\"isDataAction\":true,\"display\":{\"provider\":\"m\",\"resource\":\"hmtzopbsphrup\",\"operation\":\"dgs\",\"description\":\"bb\"}},{\"name\":\"jhphoyc\",\"isDataAction\":true,\"display\":{\"provider\":\"obhdxbmtqioqjze\",\"resource\":\"tbmufpo\",\"operation\":\"noi\",\"description\":\"hwlrx\"}},{\"name\":\"bqsoqijg\",\"isDataAction\":true,\"display\":{\"provider\":\"pazlobcufpdz\",\"resource\":\"rbt\",\"operation\":\"qqjnqgl\",\"description\":\"qgn\"}}],\"nextLink\":\"ooojywifsqe\"}")
                .toObject(ElasticSanOperationListResult.class);
        Assertions.assertEquals("mhquvgjxp", model.value().get(0).name());
        Assertions.assertEquals("ooojywifsqe", model.nextLink());
    }

    @Test
    public void testSerialize() {
        ElasticSanOperationListResult model =
            new ElasticSanOperationListResult()
                .withValue(
                    Arrays
                        .asList(
                            new ElasticSanRPOperationInner().withName("mhquvgjxp"),
                            new ElasticSanRPOperationInner().withName("jhphoyc"),
                            new ElasticSanRPOperationInner().withName("bqsoqijg")))
                .withNextLink("ooojywifsqe");
        model = BinaryData.fromObject(model).toObject(ElasticSanOperationListResult.class);
        Assertions.assertEquals("mhquvgjxp", model.value().get(0).name());
        Assertions.assertEquals("ooojywifsqe", model.nextLink());
    }
}
