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

package com.azure.resourcemanager.devspaces.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devspaces.fluent.models.ResourceProviderOperationDefinitionInner;
import com.azure.resourcemanager.devspaces.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\":\"noi\",\"display\":{\"provider\":\"lrxybqsoq\",\"resource\":\"gkdmb\",\"operation\":\"zlobcufpd\",\"description\":\"rbt\"}}")
                .toObject(ResourceProviderOperationDefinitionInner.class);
        Assertions.assertEquals("noi", model.name());
        Assertions.assertEquals("lrxybqsoq", model.display().provider());
        Assertions.assertEquals("gkdmb", model.display().resource());
        Assertions.assertEquals("zlobcufpd", model.display().operation());
        Assertions.assertEquals("rbt", model.display().description());
    }

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