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

package com.azure.resourcemanager.deploymentmanager.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.deploymentmanager.models.OperationDetail;
import org.junit.jupiter.api.Assertions;

public final class OperationDetailTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OperationDetail model =
            BinaryData
                .fromString(
                    "{\"provider\":\"ukgjnpiucgygevq\",\"resource\":\"typmrbpizcdrqjsd\",\"operation\":\"dnfyhxdeoejzicwi\",\"description\":\"jttgzf\"}")
                .toObject(OperationDetail.class);
        Assertions.assertEquals("ukgjnpiucgygevq", model.provider());
        Assertions.assertEquals("typmrbpizcdrqjsd", model.resource());
        Assertions.assertEquals("dnfyhxdeoejzicwi", model.operation());
        Assertions.assertEquals("jttgzf", model.description());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationDetail model =
            new OperationDetail()
                .withProvider("ukgjnpiucgygevq")
                .withResource("typmrbpizcdrqjsd")
                .withOperation("dnfyhxdeoejzicwi")
                .withDescription("jttgzf");
        model = BinaryData.fromObject(model).toObject(OperationDetail.class);
        Assertions.assertEquals("ukgjnpiucgygevq", model.provider());
        Assertions.assertEquals("typmrbpizcdrqjsd", model.resource());
        Assertions.assertEquals("dnfyhxdeoejzicwi", model.operation());
        Assertions.assertEquals("jttgzf", model.description());
    }
}
