AllTagsPageCollection extends ScenarioSummaryPageCollection { public Map<Tag, ResultCount> getTagResultCounts() { return tagResultCounts; } AllTagsPageCollection(List<Report> reports, final String pageTitle); Map<Tag, ResultCount> getTagResultCounts(); Set<Tag> getTags(); int getTotalNumberOfTags();  }
@Test public void getEmptyTagStatsTest() { List<Report> reports = new ArrayList<>(); allTagsPageCollection = new AllTagsPageCollection(reports, ""); Map<Tag, ResultCount> tagStats = allTagsPageCollection.getTagResultCounts(); assertThat(tagStats.size(), is(0)); }
@Test public void getTagStatsTest() { allTagsPageCollection = new AllTagsPageCollection(getTestReports(), ""); Map<Tag, ResultCount> tagStats = allTagsPageCollection.getTagResultCounts(); assertThat(tagStats.size(), is(3)); Tag tag1 = new Tag(); tag1.setName("tag1"); ResultCount tag1Stats = tagStats.get(tag1); assertThat(tag1Stats.getTotal(), is(1)); assertThat(tag1Stats.getPassed(), is(0)); assertThat(tag1Stats.getFailed(), is(1)); assertThat(tag1Stats.getSkipped(), is(0)); Tag tag2 = new Tag(); tag2.setName("tag2"); ResultCount tag2Stats = tagStats.get(tag2); assertThat(tag2Stats.getTotal(), is(2)); assertThat(tag2Stats.getPassed(), is(1)); assertThat(tag2Stats.getFailed(), is(1)); assertThat(tag2Stats.getSkipped(), is(0)); Tag tag3 = new Tag(); tag3.setName("tag3"); ResultCount tag3Stats = tagStats.get(tag3); assertThat(tag3Stats.getTotal(), is(1)); assertThat(tag3Stats.getPassed(), is(0)); assertThat(tag3Stats.getFailed(), is(0)); assertThat(tag3Stats.getSkipped(), is(1)); }