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

package com.azure.resourcemanager.reservations.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.reservations.fluent.models.OperationResponseInner;
import com.azure.resourcemanager.reservations.models.OperationDisplay;
import org.junit.jupiter.api.Assertions;

public final class OperationResponseInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OperationResponseInner model =
            BinaryData
                .fromString(
                    "{\"name\":\"mtxpsiebtfh\",\"isDataAction\":false,\"display\":{\"provider\":\"pskrdqmh\",\"resource\":\"dhtldwkyz\",\"operation\":\"utknc\",\"description\":\"cwsvlxotog\"},\"origin\":\"rupqsxvnmicy\",\"properties\":\"dataceoveilovno\"}")
                .toObject(OperationResponseInner.class);
        Assertions.assertEquals("mtxpsiebtfh", model.name());
        Assertions.assertEquals(false, model.isDataAction());
        Assertions.assertEquals("pskrdqmh", model.display().provider());
        Assertions.assertEquals("dhtldwkyz", model.display().resource());
        Assertions.assertEquals("utknc", model.display().operation());
        Assertions.assertEquals("cwsvlxotog", model.display().description());
        Assertions.assertEquals("rupqsxvnmicy", model.origin());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationResponseInner model =
            new OperationResponseInner()
                .withName("mtxpsiebtfh")
                .withIsDataAction(false)
                .withDisplay(
                    new OperationDisplay()
                        .withProvider("pskrdqmh")
                        .withResource("dhtldwkyz")
                        .withOperation("utknc")
                        .withDescription("cwsvlxotog"))
                .withOrigin("rupqsxvnmicy")
                .withProperties("dataceoveilovno");
        model = BinaryData.fromObject(model).toObject(OperationResponseInner.class);
        Assertions.assertEquals("mtxpsiebtfh", model.name());
        Assertions.assertEquals(false, model.isDataAction());
        Assertions.assertEquals("pskrdqmh", model.display().provider());
        Assertions.assertEquals("dhtldwkyz", model.display().resource());
        Assertions.assertEquals("utknc", model.display().operation());
        Assertions.assertEquals("cwsvlxotog", model.display().description());
        Assertions.assertEquals("rupqsxvnmicy", model.origin());
    }
}
