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

package com.azure.resourcemanager.changeanalysis.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.changeanalysis.fluent.models.ResourceProviderOperationDefinitionInner;
import com.azure.resourcemanager.changeanalysis.models.ResourceProviderOperationDisplay;
import org.junit.jupiter.api.Assertions;

public final class ResourceProviderOperationDefinitionInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ResourceProviderOperationDefinitionInner model =
            BinaryData
                .fromString(
                    "{\"name\":\"nygj\",\"display\":{\"provider\":\"ddeqsrdeupewnwre\",\"resource\":\"jzyflu\",\"operation\":\"rh\",\"description\":\"fcqhsmyurkd\"}}")
                .toObject(ResourceProviderOperationDefinitionInner.class);
        Assertions.assertEquals("nygj", model.name());
        Assertions.assertEquals("ddeqsrdeupewnwre", model.display().provider());
        Assertions.assertEquals("jzyflu", model.display().resource());
        Assertions.assertEquals("rh", model.display().operation());
        Assertions.assertEquals("fcqhsmyurkd", model.display().description());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ResourceProviderOperationDefinitionInner model =
            new ResourceProviderOperationDefinitionInner()
                .withName("nygj")
                .withDisplay(
                    new ResourceProviderOperationDisplay()
                        .withProvider("ddeqsrdeupewnwre")
                        .withResource("jzyflu")
                        .withOperation("rh")
                        .withDescription("fcqhsmyurkd"));
        model = BinaryData.fromObject(model).toObject(ResourceProviderOperationDefinitionInner.class);
        Assertions.assertEquals("nygj", model.name());
        Assertions.assertEquals("ddeqsrdeupewnwre", model.display().provider());
        Assertions.assertEquals("jzyflu", model.display().resource());
        Assertions.assertEquals("rh", model.display().operation());
        Assertions.assertEquals("fcqhsmyurkd", model.display().description());
    }
}
