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

package com.azure.resourcemanager.devtestlabs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devtestlabs.fluent.models.OperationMetadataInner;
import com.azure.resourcemanager.devtestlabs.models.OperationMetadataDisplay;
import org.junit.jupiter.api.Assertions;

public final class OperationMetadataInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OperationMetadataInner model =
            BinaryData
                .fromString(
                    "{\"name\":\"nygj\",\"display\":{\"provider\":\"ddeqsrdeupewnwre\",\"resource\":\"jzyflu\",\"operation\":\"rh\",\"description\":\"fcqhsmyurkd\"}}")
                .toObject(OperationMetadataInner.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 {
        OperationMetadataInner model =
            new OperationMetadataInner()
                .withName("nygj")
                .withDisplay(
                    new OperationMetadataDisplay()
                        .withProvider("ddeqsrdeupewnwre")
                        .withResource("jzyflu")
                        .withOperation("rh")
                        .withDescription("fcqhsmyurkd"));
        model = BinaryData.fromObject(model).toObject(OperationMetadataInner.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());
    }
}
