コード例 #1
0
  @Test
  public void testShowEmptyIssue() throws Exception {

    screen.show(Issue.EMPTY);

    verify(view).setIssueTitle("---");
    ArgumentCaptor<SafeHtml> safeHtmlArgumentCaptor = ArgumentCaptor.forClass(SafeHtml.class);
    verify(view).setExplanation(safeHtmlArgumentCaptor.capture());
    assertEquals("---", safeHtmlArgumentCaptor.getValue().asString());
    verify(view).setLines("");
  }
コード例 #2
0
  @Test
  public void testClear() throws Exception {
    screen.clear();

    verify(view).setIssueTitle("");
    ArgumentCaptor<SafeHtml> safeHtmlArgumentCaptor = ArgumentCaptor.forClass(SafeHtml.class);
    verify(view).setExplanation(safeHtmlArgumentCaptor.capture());
    assertEquals("", safeHtmlArgumentCaptor.getValue().asString());
    verify(view).hideLines();
    verify(view).setLines("");
  }
コード例 #3
0
  @Test
  public void testShow() throws Exception {

    Issue issue =
        new Issue(
            Severity.WARNING, CheckType.REDUNDANT_ROWS, new HashSet<>(Arrays.asList(1, 2, 3)));

    screen.show(issue);

    verify(view).setIssueTitle("RedundantRows");
    ArgumentCaptor<SafeHtml> safeHtmlArgumentCaptor = ArgumentCaptor.forClass(SafeHtml.class);
    verify(view).setExplanation(safeHtmlArgumentCaptor.capture());
    assertEquals("<p>MissingRangeP1(2)</p>", safeHtmlArgumentCaptor.getValue().asString());
    verify(view).setLines("1, 2, 3");
  }