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

package com.azure.resourcemanager.imagebuilder.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.imagebuilder.fluent.models.OperationInner;
import com.azure.resourcemanager.imagebuilder.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\":\"a\",\"display\":{\"provider\":\"z\",\"operation\":\"vvtpgvdfgio\",\"resource\":\"ftutqxlngxlefgu\",\"description\":\"xkrxdqmi\"},\"origin\":\"thz\",\"properties\":\"dataqdrabhjybigehoqf\",\"isDataAction\":false}")
                .toObject(OperationInner.class);
        Assertions.assertEquals("a", model.name());
        Assertions.assertEquals("z", model.display().provider());
        Assertions.assertEquals("vvtpgvdfgio", model.display().operation());
        Assertions.assertEquals("ftutqxlngxlefgu", model.display().resource());
        Assertions.assertEquals("xkrxdqmi", model.display().description());
        Assertions.assertEquals("thz", model.origin());
        Assertions.assertEquals(false, model.isDataAction());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationInner model =
            new OperationInner()
                .withName("a")
                .withDisplay(
                    new OperationDisplay()
                        .withProvider("z")
                        .withOperation("vvtpgvdfgio")
                        .withResource("ftutqxlngxlefgu")
                        .withDescription("xkrxdqmi"))
                .withOrigin("thz")
                .withProperties("dataqdrabhjybigehoqf")
                .withIsDataAction(false);
        model = BinaryData.fromObject(model).toObject(OperationInner.class);
        Assertions.assertEquals("a", model.name());
        Assertions.assertEquals("z", model.display().provider());
        Assertions.assertEquals("vvtpgvdfgio", model.display().operation());
        Assertions.assertEquals("ftutqxlngxlefgu", model.display().resource());
        Assertions.assertEquals("xkrxdqmi", model.display().description());
        Assertions.assertEquals("thz", model.origin());
        Assertions.assertEquals(false, model.isDataAction());
    }
}
