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

package com.azure.resourcemanager.policyinsights.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.policyinsights.models.OperationDisplay;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class OperationDisplayTests {
    @Test
    public void testDeserialize() {
        OperationDisplay model =
            BinaryData
                .fromString(
                    "{\"provider\":\"sotbob\",\"resource\":\"opcjwvnhd\",\"operation\":\"wmgxcxrsl\",\"description\":\"utwu\"}")
                .toObject(OperationDisplay.class);
        Assertions.assertEquals("sotbob", model.provider());
        Assertions.assertEquals("opcjwvnhd", model.resource());
        Assertions.assertEquals("wmgxcxrsl", model.operation());
        Assertions.assertEquals("utwu", model.description());
    }

    @Test
    public void testSerialize() {
        OperationDisplay model =
            new OperationDisplay()
                .withProvider("sotbob")
                .withResource("opcjwvnhd")
                .withOperation("wmgxcxrsl")
                .withDescription("utwu");
        model = BinaryData.fromObject(model).toObject(OperationDisplay.class);
        Assertions.assertEquals("sotbob", model.provider());
        Assertions.assertEquals("opcjwvnhd", model.resource());
        Assertions.assertEquals("wmgxcxrsl", model.operation());
        Assertions.assertEquals("utwu", model.description());
    }
}
