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

package com.azure.resourcemanager.kusto.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.kusto.fluent.models.OperationInner;
import com.azure.resourcemanager.kusto.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\":\"dsofbshrns\",\"display\":{\"provider\":\"swdvzyybycnun\",\"operation\":\"srtkfa\",\"resource\":\"opqgikyzirtxdyux\",\"description\":\"jntpsewgioilqu\"},\"origin\":\"ydxtqm\",\"properties\":\"dataox\"}")
                .toObject(OperationInner.class);
        Assertions.assertEquals("dsofbshrns", model.name());
        Assertions.assertEquals("swdvzyybycnun", model.display().provider());
        Assertions.assertEquals("srtkfa", model.display().operation());
        Assertions.assertEquals("opqgikyzirtxdyux", model.display().resource());
        Assertions.assertEquals("jntpsewgioilqu", model.display().description());
        Assertions.assertEquals("ydxtqm", model.origin());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationInner model =
            new OperationInner()
                .withName("dsofbshrns")
                .withDisplay(
                    new OperationDisplay()
                        .withProvider("swdvzyybycnun")
                        .withOperation("srtkfa")
                        .withResource("opqgikyzirtxdyux")
                        .withDescription("jntpsewgioilqu"))
                .withOrigin("ydxtqm")
                .withProperties("dataox");
        model = BinaryData.fromObject(model).toObject(OperationInner.class);
        Assertions.assertEquals("dsofbshrns", model.name());
        Assertions.assertEquals("swdvzyybycnun", model.display().provider());
        Assertions.assertEquals("srtkfa", model.display().operation());
        Assertions.assertEquals("opqgikyzirtxdyux", model.display().resource());
        Assertions.assertEquals("jntpsewgioilqu", model.display().description());
        Assertions.assertEquals("ydxtqm", model.origin());
    }
}
