// 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.fluent.models.OperationsListInner;
import com.azure.resourcemanager.deploymentmanager.models.Operation;
import com.azure.resourcemanager.deploymentmanager.models.OperationDetail;
import org.junit.jupiter.api.Assertions;

public final class OperationsListInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OperationsListInner model =
            BinaryData
                .fromString(
                    "{\"value\":{\"name\":\"idyjrrfbyaosvexc\",\"display\":{\"provider\":\"pclhocohslk\",\"resource\":\"leggzfbu\",\"operation\":\"mvfaxkffeiith\",\"description\":\"m\"},\"origin\":\"yvshxmz\",\"properties\":\"databzoggigrx\"}}")
                .toObject(OperationsListInner.class);
        Assertions.assertEquals("idyjrrfbyaosvexc", model.value().name());
        Assertions.assertEquals("pclhocohslk", model.value().display().provider());
        Assertions.assertEquals("leggzfbu", model.value().display().resource());
        Assertions.assertEquals("mvfaxkffeiith", model.value().display().operation());
        Assertions.assertEquals("m", model.value().display().description());
        Assertions.assertEquals("yvshxmz", model.value().origin());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationsListInner model =
            new OperationsListInner()
                .withValue(
                    new Operation()
                        .withName("idyjrrfbyaosvexc")
                        .withDisplay(
                            new OperationDetail()
                                .withProvider("pclhocohslk")
                                .withResource("leggzfbu")
                                .withOperation("mvfaxkffeiith")
                                .withDescription("m"))
                        .withOrigin("yvshxmz")
                        .withProperties("databzoggigrx"));
        model = BinaryData.fromObject(model).toObject(OperationsListInner.class);
        Assertions.assertEquals("idyjrrfbyaosvexc", model.value().name());
        Assertions.assertEquals("pclhocohslk", model.value().display().provider());
        Assertions.assertEquals("leggzfbu", model.value().display().resource());
        Assertions.assertEquals("mvfaxkffeiith", model.value().display().operation());
        Assertions.assertEquals("m", model.value().display().description());
        Assertions.assertEquals("yvshxmz", model.value().origin());
    }
}
