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

package com.azure.resourcemanager.advisor.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.advisor.fluent.models.OperationEntityInner;
import com.azure.resourcemanager.advisor.models.OperationDisplayInfo;
import org.junit.jupiter.api.Assertions;

public final class OperationEntityInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OperationEntityInner model =
            BinaryData
                .fromString(
                    "{\"name\":\"jrefovgmkqsle\",\"display\":{\"description\":\"xyqj\",\"operation\":\"cattpngjcrcczsq\",\"provider\":\"hvmdajvnysounq\",\"resource\":\"a\"}}")
                .toObject(OperationEntityInner.class);
        Assertions.assertEquals("jrefovgmkqsle", model.name());
        Assertions.assertEquals("xyqj", model.display().description());
        Assertions.assertEquals("cattpngjcrcczsq", model.display().operation());
        Assertions.assertEquals("hvmdajvnysounq", model.display().provider());
        Assertions.assertEquals("a", model.display().resource());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationEntityInner model =
            new OperationEntityInner()
                .withName("jrefovgmkqsle")
                .withDisplay(
                    new OperationDisplayInfo()
                        .withDescription("xyqj")
                        .withOperation("cattpngjcrcczsq")
                        .withProvider("hvmdajvnysounq")
                        .withResource("a"));
        model = BinaryData.fromObject(model).toObject(OperationEntityInner.class);
        Assertions.assertEquals("jrefovgmkqsle", model.name());
        Assertions.assertEquals("xyqj", model.display().description());
        Assertions.assertEquals("cattpngjcrcczsq", model.display().operation());
        Assertions.assertEquals("hvmdajvnysounq", model.display().provider());
        Assertions.assertEquals("a", model.display().resource());
    }
}
