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

package com.azure.resourcemanager.logic.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.logic.fluent.models.OperationInner;
import com.azure.resourcemanager.logic.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(
                    "{\"origin\":\"tekva\",\"name\":\"l\",\"display\":{\"provider\":\"qvqyvweht\",\"resource\":\"mxhzzysevus\",\"operation\":\"vzrrryveimi\",\"description\":\"kdyzatvfuzk\"},\"properties\":\"datatjvv\"}")
                .toObject(OperationInner.class);
        Assertions.assertEquals("tekva", model.origin());
        Assertions.assertEquals("l", model.name());
        Assertions.assertEquals("qvqyvweht", model.display().provider());
        Assertions.assertEquals("mxhzzysevus", model.display().resource());
        Assertions.assertEquals("vzrrryveimi", model.display().operation());
        Assertions.assertEquals("kdyzatvfuzk", model.display().description());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationInner model =
            new OperationInner()
                .withOrigin("tekva")
                .withName("l")
                .withDisplay(
                    new OperationDisplay()
                        .withProvider("qvqyvweht")
                        .withResource("mxhzzysevus")
                        .withOperation("vzrrryveimi")
                        .withDescription("kdyzatvfuzk"))
                .withProperties("datatjvv");
        model = BinaryData.fromObject(model).toObject(OperationInner.class);
        Assertions.assertEquals("tekva", model.origin());
        Assertions.assertEquals("l", model.name());
        Assertions.assertEquals("qvqyvweht", model.display().provider());
        Assertions.assertEquals("mxhzzysevus", model.display().resource());
        Assertions.assertEquals("vzrrryveimi", model.display().operation());
        Assertions.assertEquals("kdyzatvfuzk", model.display().description());
    }
}
