Example #1
0
  @Test
  public void check() {
    XPathCheck check = new XPathCheck();
    check.xpathQuery = "//IDENTIFIER[string-length(@tokenValue) >= 10]";
    check.message = "Avoid identifiers which are too long!";

    SourceFile file = scanFile("/checks/xpath.cs", check);
    CheckMessagesVerifier.verify(file.getCheckMessages())
        .next()
        .atLine(7)
        .withMessage("Avoid identifiers which are too long!")
        .noMore();
  }
  @Test
  public void check() {
    XPathCheck check = new XPathCheck();
    check.xpathQuery = "//IDENTIFIER[string-length(@tokenValue) >= 10]";
    check.message = "Avoid identifiers which are too long!";

    SourceFile file =
        CSharpAstScanner.scanSingleFile(new File("src/test/resources/checks/xpath.cs"), check);
    checkMessagesVerifier
        .verify(file.getCheckMessages())
        .next()
        .atLine(7)
        .withMessage("Avoid identifiers which are too long!");
  }