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

package com.azure.resourcemanager.azurestack.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.azurestack.fluent.models.OperationInner;
import com.azure.resourcemanager.azurestack.models.Display;
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\":\"itjz\",\"display\":{\"provider\":\"usarhmofc\",\"resource\":\"smy\",\"operation\":\"kdtmlxhekuk\",\"description\":\"txukcdmp\"},\"origin\":\"cryuan\"}")
                .toObject(OperationInner.class);
        Assertions.assertEquals("itjz", model.name());
        Assertions.assertEquals("usarhmofc", model.display().provider());
        Assertions.assertEquals("smy", model.display().resource());
        Assertions.assertEquals("kdtmlxhekuk", model.display().operation());
        Assertions.assertEquals("txukcdmp", model.display().description());
        Assertions.assertEquals("cryuan", model.origin());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationInner model =
            new OperationInner()
                .withName("itjz")
                .withDisplay(
                    new Display()
                        .withProvider("usarhmofc")
                        .withResource("smy")
                        .withOperation("kdtmlxhekuk")
                        .withDescription("txukcdmp"))
                .withOrigin("cryuan");
        model = BinaryData.fromObject(model).toObject(OperationInner.class);
        Assertions.assertEquals("itjz", model.name());
        Assertions.assertEquals("usarhmofc", model.display().provider());
        Assertions.assertEquals("smy", model.display().resource());
        Assertions.assertEquals("kdtmlxhekuk", model.display().operation());
        Assertions.assertEquals("txukcdmp", model.display().description());
        Assertions.assertEquals("cryuan", model.origin());
    }
}
