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

package com.azure.resourcemanager.confidentialledger.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.confidentialledger.fluent.models.ResourceProviderOperationDefinitionInner;
import com.azure.resourcemanager.confidentialledger.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\":\"fogknygjofjdde\",\"isDataAction\":false,\"display\":{\"provider\":\"upewnwreitjzy\",\"resource\":\"usarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"}}")
                .toObject(ResourceProviderOperationDefinitionInner.class);
        Assertions.assertEquals("fogknygjofjdde", model.name());
        Assertions.assertEquals(false, model.isDataAction());
        Assertions.assertEquals("upewnwreitjzy", model.display().provider());
        Assertions.assertEquals("usarhmofc", model.display().resource());
        Assertions.assertEquals("smy", model.display().operation());
        Assertions.assertEquals("kdtmlxhekuk", model.display().description());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ResourceProviderOperationDefinitionInner model =
            new ResourceProviderOperationDefinitionInner()
                .withName("fogknygjofjdde")
                .withIsDataAction(false)
                .withDisplay(
                    new ResourceProviderOperationDisplay()
                        .withProvider("upewnwreitjzy")
                        .withResource("usarhmofc")
                        .withOperation("smy")
                        .withDescription("kdtmlxhekuk"));
        model = BinaryData.fromObject(model).toObject(ResourceProviderOperationDefinitionInner.class);
        Assertions.assertEquals("fogknygjofjdde", model.name());
        Assertions.assertEquals(false, model.isDataAction());
        Assertions.assertEquals("upewnwreitjzy", model.display().provider());
        Assertions.assertEquals("usarhmofc", model.display().resource());
        Assertions.assertEquals("smy", model.display().operation());
        Assertions.assertEquals("kdtmlxhekuk", model.display().description());
    }
}
