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

package com.azure.resourcemanager.nginx.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner;
import com.azure.resourcemanager.nginx.models.OperationDisplay;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class OperationResultInnerTests {
    @Test
    public void testDeserialize() {
        OperationResultInner model =
            BinaryData
                .fromString(
                    "{\"name\":\"jiwkuofoskghsau\",\"display\":{\"provider\":\"jmvxie\",\"resource\":\"ugidyjrr\",\"operation\":\"y\",\"description\":\"svexcsonpclhoco\"},\"isDataAction\":false}")
                .toObject(OperationResultInner.class);
        Assertions.assertEquals("jiwkuofoskghsau", model.name());
        Assertions.assertEquals("jmvxie", model.display().provider());
        Assertions.assertEquals("ugidyjrr", model.display().resource());
        Assertions.assertEquals("y", model.display().operation());
        Assertions.assertEquals("svexcsonpclhoco", model.display().description());
        Assertions.assertEquals(false, model.isDataAction());
    }

    @Test
    public void testSerialize() {
        OperationResultInner model =
            new OperationResultInner()
                .withName("jiwkuofoskghsau")
                .withDisplay(
                    new OperationDisplay()
                        .withProvider("jmvxie")
                        .withResource("ugidyjrr")
                        .withOperation("y")
                        .withDescription("svexcsonpclhoco"))
                .withIsDataAction(false);
        model = BinaryData.fromObject(model).toObject(OperationResultInner.class);
        Assertions.assertEquals("jiwkuofoskghsau", model.name());
        Assertions.assertEquals("jmvxie", model.display().provider());
        Assertions.assertEquals("ugidyjrr", model.display().resource());
        Assertions.assertEquals("y", model.display().operation());
        Assertions.assertEquals("svexcsonpclhoco", model.display().description());
        Assertions.assertEquals(false, model.isDataAction());
    }
}
