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

package com.azure.resourcemanager.quota.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner;
import com.azure.resourcemanager.quota.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\":\"vlejuvfqa\",\"display\":{\"provider\":\"yxwjkcp\",\"resource\":\"nwbxgjvtbvpyssz\",\"operation\":\"rujqg\",\"description\":\"muouqfp\"},\"origin\":\"zw\"}")
                .toObject(OperationResponseInner.class);
        Assertions.assertEquals("vlejuvfqa", model.name());
        Assertions.assertEquals("yxwjkcp", model.display().provider());
        Assertions.assertEquals("nwbxgjvtbvpyssz", model.display().resource());
        Assertions.assertEquals("rujqg", model.display().operation());
        Assertions.assertEquals("muouqfp", model.display().description());
        Assertions.assertEquals("zw", model.origin());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationResponseInner model =
            new OperationResponseInner()
                .withName("vlejuvfqa")
                .withDisplay(
                    new OperationDisplay()
                        .withProvider("yxwjkcp")
                        .withResource("nwbxgjvtbvpyssz")
                        .withOperation("rujqg")
                        .withDescription("muouqfp"))
                .withOrigin("zw");
        model = BinaryData.fromObject(model).toObject(OperationResponseInner.class);
        Assertions.assertEquals("vlejuvfqa", model.name());
        Assertions.assertEquals("yxwjkcp", model.display().provider());
        Assertions.assertEquals("nwbxgjvtbvpyssz", model.display().resource());
        Assertions.assertEquals("rujqg", model.display().operation());
        Assertions.assertEquals("muouqfp", model.display().description());
        Assertions.assertEquals("zw", model.origin());
    }
}
