content: /**
   * Copied and adapted from plugin
   * <a href="https://github.com/neueda/jetbrains-plugin-graph-database-support">Graph Database Support</a>
   * by Neueda Technologies, Ltd.
   * Modified by Alberto Venturini, 2022
   */
  package com.albertoventurini.graphdbplugin.test.integration.neo4j.tests.cypher.documentation;
  
  import com.albertoventurini.graphdbplugin.language.cypher.completion.metadata.CypherMetadataContainer;
  import com.albertoventurini.graphdbplugin.language.cypher.documentation.database.CypherDocumentation;
  import com.albertoventurini.graphdbplugin.test.integration.neo4j.tests.cypher.util.BaseDocumentationTest;
  
  
  import static org.assertj.core.api.Assertions.assertThat;
  
  public class AutoGeneratedUserFunctionDocumentationTest extends BaseDocumentationTest {
  
      private CypherMetadataContainer metadata;
  
      @Override
      public void setUp() throws Exception {
          super.setUp();
          dataSource().neo4j52();
          metadata = services().cypherMetadataProvider().getContainer("documentationTest");
      }
  
      public void testFunctionBody() throws Exception {
          var expectedDocumentation = "function <b>toString</b><br>Arguments:<br>&nbsp;&nbsp;&nbsp;&nbsp;(input :: ANY?)<br>Return:<br>&nbsp;&nbsp;&nbsp;&nbsp;STRING?<br><br>Converts an integer, float, boolean, point or temporal type (i.e. Date, Time, LocalTime, DateTime, LocalDateTime or Duration) value to a string.";
          configure("RETURN toStr<caret>ing(42);");
          verify(expectedDocumentation);
      }
  
      public void testExistingUserFunctionDocumentationWithoutDescription() throws Exception {
          metadata.addFunction("test.userFunctionName", "(functionSignature)", null);
          configure("RETURN test.user<caret>FunctionName(42);");
          assertThat(verify())
                  .contains("function")
                  .contains("test.userFunctionName")
                  .contains("Arguments")
                  .contains("(functionSignature)")
                  .contains("Return")
                  .contains("ANY");
      }
  
      public void testExistingUserFunctionDocumentationWithDescription() throws Exception {
          metadata.addFunction("test.userFunctionName", "(functionSignature)", "My cool description");
          configure("RETURN test.user<caret>FunctionName(42);");
          assertThat(verify())
                  .contains("function")
                  .contains("test.userFunctionName")
                  .contains("Arguments")
                  .contains("(functionSignature)")
                  .contains("Return")
                  .contains("ANY")
                  .contains("My cool description");
      }
  
      public void testNonExistingUserFunctionNoDocumentation() throws Exception {
          configure("RETURN test.user<caret>FunctionName(42);");
          verify(null);
      }
  }
  