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

package com.azure.resourcemanager.azurearcdata.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.azurearcdata.fluent.models.OperationInner;
import com.azure.resourcemanager.azurearcdata.models.OperationDisplay;
import org.junit.jupiter.api.Assertions;

public final class OperationInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OperationInner model =
            BinaryData
                .fromString(
                    "{\"name\":\"lokjyemkk\",\"display\":{\"provider\":\"ni\",\"resource\":\"joxzjnchgejspodm\",\"operation\":\"ilzyd\",\"description\":\"h\"},\"origin\":\"system\",\"isDataAction\":false,\"properties\":{\"ixjsprozvcputeg\":\"datauxinpmqnjaq\",\"atscmd\":\"datavwmf\",\"zkrwfn\":\"datapjhulsuuvmkj\"}}")
                .toObject(OperationInner.class);
        Assertions.assertEquals("lokjyemkk", model.name());
        Assertions.assertEquals("ni", model.display().provider());
        Assertions.assertEquals("joxzjnchgejspodm", model.display().resource());
        Assertions.assertEquals("ilzyd", model.display().operation());
        Assertions.assertEquals("h", model.display().description());
        Assertions.assertEquals(false, model.isDataAction());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationInner model =
            new OperationInner()
                .withName("lokjyemkk")
                .withDisplay(
                    new OperationDisplay()
                        .withProvider("ni")
                        .withResource("joxzjnchgejspodm")
                        .withOperation("ilzyd")
                        .withDescription("h"))
                .withIsDataAction(false);
        model = BinaryData.fromObject(model).toObject(OperationInner.class);
        Assertions.assertEquals("lokjyemkk", model.name());
        Assertions.assertEquals("ni", model.display().provider());
        Assertions.assertEquals("joxzjnchgejspodm", model.display().resource());
        Assertions.assertEquals("ilzyd", model.display().operation());
        Assertions.assertEquals("h", model.display().description());
        Assertions.assertEquals(false, model.isDataAction());
    }
}
