use of nl.ramsolutions.sw.magik.checks.MagikCheck in project magik-tools by StevenLooman.
the class MethodComplexityCheckTest method testNotTooComplex.
@Test
void testNotTooComplex() {
final MagikCheck check = new MethodComplexityCheck();
final String code = "" + "_method a.b\n" + " _if a" + " _then" + " _endif\n" + "_endmethod\n";
final List<MagikIssue> issues = this.runCheck(code, check);
assertThat(issues).isEmpty();
}
use of nl.ramsolutions.sw.magik.checks.MagikCheck in project magik-tools by StevenLooman.
the class MethodDocCheckTest method testMethodDocMissingParametersSingle.
@Test
void testMethodDocMissingParametersSingle() {
final MagikCheck check = new MethodDocCheck();
final String code = "" + "_method a.b(param1, param2)\n" + " ## Function: example\n" + " ## Parameters: PARAM1: example parameters\n" + " ## Returns: -\n" + "_endmethod";
final List<MagikIssue> issues = this.runCheck(code, check);
assertThat(issues).hasSize(1);
}
use of nl.ramsolutions.sw.magik.checks.MagikCheck in project magik-tools by StevenLooman.
the class MethodDocCheckTest method testMethodDocParametersIndexMissing.
@Test
void testMethodDocParametersIndexMissing() {
final MagikCheck check = new MethodDocCheck();
final String code = "" + "_method a[index]\n" + " ## Function: example\n" + " ## Parameters: -\n" + " ## Returns: -\n" + "_endmethod";
final List<MagikIssue> issues = this.runCheck(code, check);
assertThat(issues).hasSize(1);
}
use of nl.ramsolutions.sw.magik.checks.MagikCheck in project magik-tools by StevenLooman.
the class MethodDocCheckTest method testMethodDocMissingFunction.
@Test
void testMethodDocMissingFunction() {
final MagikCheck check = new MethodDocCheck();
final String code = "" + "_method a.b(param1)\n" + " ## Parameters: PARAM1: example parameters\n" + " ## Returns: -\n" + "_endmethod";
final List<MagikIssue> issues = this.runCheck(code, check);
assertThat(issues).hasSize(1);
}
use of nl.ramsolutions.sw.magik.checks.MagikCheck in project magik-tools by StevenLooman.
the class MethodDocCheckTest method testMethodDocParametersOptional.
@Test
void testMethodDocParametersOptional() {
final MagikCheck check = new MethodDocCheck();
final String code = "" + "_method a.b(_optional param1)\n" + " ## Function: example\n" + " ## Parameters: PARAM1: parameter 1\n" + " ## Returns: -\n" + "_endmethod";
final List<MagikIssue> issues = this.runCheck(code, check);
assertThat(issues).isEmpty();
}
Aggregations