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

package com.azure.resourcemanager.logic.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.logic.models.ApiDeploymentParameterMetadata;
import com.azure.resourcemanager.logic.models.ApiDeploymentParameterVisibility;
import org.junit.jupiter.api.Assertions;

public final class ApiDeploymentParameterMetadataTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ApiDeploymentParameterMetadata model =
            BinaryData
                .fromString(
                    "{\"type\":\"tgoe\",\"isRequired\":false,\"displayName\":\"abpfhvfs\",\"description\":\"vntjlrigjk\",\"visibility\":\"NotSpecified\"}")
                .toObject(ApiDeploymentParameterMetadata.class);
        Assertions.assertEquals("tgoe", model.type());
        Assertions.assertEquals(false, model.isRequired());
        Assertions.assertEquals("abpfhvfs", model.displayName());
        Assertions.assertEquals("vntjlrigjk", model.description());
        Assertions.assertEquals(ApiDeploymentParameterVisibility.NOT_SPECIFIED, model.visibility());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ApiDeploymentParameterMetadata model =
            new ApiDeploymentParameterMetadata()
                .withType("tgoe")
                .withIsRequired(false)
                .withDisplayName("abpfhvfs")
                .withDescription("vntjlrigjk")
                .withVisibility(ApiDeploymentParameterVisibility.NOT_SPECIFIED);
        model = BinaryData.fromObject(model).toObject(ApiDeploymentParameterMetadata.class);
        Assertions.assertEquals("tgoe", model.type());
        Assertions.assertEquals(false, model.isRequired());
        Assertions.assertEquals("abpfhvfs", model.displayName());
        Assertions.assertEquals("vntjlrigjk", model.description());
        Assertions.assertEquals(ApiDeploymentParameterVisibility.NOT_SPECIFIED, model.visibility());
    }
}
