コード例 #1
0
  @Test
  public void detected() throws Exception {
    WebSourceCode sourceCode =
        TestHelper.scan(
            new File("src/test/resources/checks/ImgWithoutAltCheck.html"),
            new ImgWithoutAltCheck());

    checkMessagesVerifier
        .verify(sourceCode.getIssues())
        .next()
        .atLine(1)
        .withMessage("Add an \"alt\" attribute to this image.")
        .next()
        .atLine(5);
  }
コード例 #2
0
  @Test
  public void detected() throws Exception {
    WebSourceCode sourceCode =
        TestHelper.scan(
            new File("src/test/resources/checks/BoldAndItalicTagsCheck.html"),
            new BoldAndItalicTagsCheck());

    checkMessagesVerifier
        .verify(sourceCode.getIssues())
        .next()
        .atLine(1)
        .withMessage("Replace this <b> tag by <strong>.")
        .next()
        .atLine(5)
        .withMessage("Replace this <i> tag by <em>.")
        .next()
        .atLine(7)
        .withMessage("Replace this <B> tag by <strong>.");
  }
コード例 #3
0
  @Test
  public void detected() throws Exception {
    WebSourceCode sourceCode =
        TestHelper.scan(
            new File("src/test/resources/checks/LinkToNothingCheck.html"),
            new LinkToNothingCheck());

    checkMessagesVerifier
        .verify(sourceCode.getIssues())
        .next()
        .atLine(3)
        .withMessage("Give this link a valid reference or remove the reference.")
        .next()
        .atLine(4)
        .next()
        .atLine(5)
        .next()
        .atLine(6);
  }