@SuppressWarnings({ "AutoBoxing", "unchecked" }) @Test public void displayMatchesDataTest() { final MatchesData data = mock(MatchesData.class); final List<MatchStatistics> stats = mock(List.class); when(data.getAllStats()).thenReturn(stats); final int nonEmpty = 1; final int empty = 2; final int failures = 3; when(data.getNonEmptyMatches()).thenReturn(nonEmpty); when(data.getEmptyMatches()).thenReturn(empty); when(data.getFailedMatches()).thenReturn(failures); final Random random = new Random(System.currentTimeMillis()); final Double topOne = random.nextDouble(); final Double topFive = random.nextDouble(); final Double topTen = random.nextDouble(); when(data.getTopOne()).thenReturn(topOne); when(data.getTopFive()).thenReturn(topFive); when(data.getTopTen()).thenReturn(topTen); doNothing().when(view).showMatches(anyList()); doNothing().when(view).showMatchesStats(anyInt(), anyInt(), anyInt()); doNothing().when(view).showTopN(any(Text.class), anyDouble()); view.displayMatchesData(data); verify(view).showMatches(same(stats)); verify(view).showMatchesStats(nonEmpty, empty, failures); verify(view).showTopN(display.topRulePct, topOne); verify(view).showTopN(display.topFiveRulePct, topFive); verify(view).showTopN(display.topTenRulePct, topTen); }
@Override public void displayMatchesData(final MatchesData data) { showMatches(data.getAllStats()); showMatchesStats(data.getNonEmptyMatches(), data.getEmptyMatches(), data.getFailedMatches()); showTopN(display.topRulePct, data.getTopOne()); showTopN(display.topFiveRulePct, data.getTopFive()); showTopN(display.topTenRulePct, data.getTopTen()); }
JavafxMatchesTabView extends JavafxView<MatchesTabPresenter, MatchesTabDisplay> implements MatchesTabView { @Override public void displayMatchesData(final MatchesData data) { showMatches(data.getAllStats()); showMatchesStats(data.getNonEmptyMatches(), data.getEmptyMatches(), data.getFailedMatches()); showTopN(display.topRulePct, data.getTopOne()); showTopN(display.topFiveRulePct, data.getTopFive()); showTopN(display.topTenRulePct, data.getTopTen()); } }
JavafxMatchesTabView extends JavafxView<MatchesTabPresenter, MatchesTabDisplay> implements MatchesTabView { @Override public void displayMatchesData(final MatchesData data) { showMatches(data.getAllStats()); showMatchesStats(data.getNonEmptyMatches(), data.getEmptyMatches(), data.getFailedMatches()); showTopN(display.topRulePct, data.getTopOne()); showTopN(display.topFiveRulePct, data.getTopFive()); showTopN(display.topTenRulePct, data.getTopTen()); } JavafxMatchesTabView(); }
JavafxMatchesTabView extends JavafxView<MatchesTabPresenter, MatchesTabDisplay> implements MatchesTabView { @Override public void displayMatchesData(final MatchesData data) { showMatches(data.getAllStats()); showMatchesStats(data.getNonEmptyMatches(), data.getEmptyMatches(), data.getFailedMatches()); showTopN(display.topRulePct, data.getTopOne()); showTopN(display.topFiveRulePct, data.getTopFive()); showTopN(display.topTenRulePct, data.getTopTen()); } JavafxMatchesTabView(); @Override void displayInfo(final ParseInfo info); @Override void displayMatchesData(final MatchesData data); }
JavafxMatchesTabView extends JavafxView<MatchesTabPresenter, MatchesTabDisplay> implements MatchesTabView { @Override public void displayMatchesData(final MatchesData data) { showMatches(data.getAllStats()); showMatchesStats(data.getNonEmptyMatches(), data.getEmptyMatches(), data.getFailedMatches()); showTopN(display.topRulePct, data.getTopOne()); showTopN(display.topFiveRulePct, data.getTopFive()); showTopN(display.topTenRulePct, data.getTopTen()); } JavafxMatchesTabView(); @Override void displayInfo(final ParseInfo info); @Override void displayMatchesData(final MatchesData data);  }