@Test public void shouldRenderExpensesOfCurrentWeek() throws Exception { presenter.renderCurrentWeeksExpenses(); ArgumentCaptor<Map> expenseCaptor = ArgumentCaptor.forClass(Map.class); verify(view).displayCurrentWeeksExpenses(expenseCaptor.capture()); Map<String, List<Expense>> expenseGroupByDate = expenseCaptor.getValue(); assertThat(expenseGroupByDate.keySet().size(), is(2)); assertThat(expenseGroupByDate.get("31-08-2015").size(), is(1)); assertThat(expenseGroupByDate.get("31-08-2015").get(0).getAmount(), is(100l)); assertThat(expenseGroupByDate.get("31-08-2015").get(0).getType(), is("Travel")); assertThat(expenseGroupByDate.get("03-09-2015").size(), is(1)); assertThat(expenseGroupByDate.get("03-09-2015").get(0).getAmount(), is(90l)); assertThat(expenseGroupByDate.get("03-09-2015").get(0).getType(), is("Food")); }
public void renderCurrentWeeksExpenses() { view.displayCurrentWeeksExpenses(expenseCollection.groupByDate()); }
CurrentWeekExpensePresenter { public void renderCurrentWeeksExpenses() { view.displayCurrentWeeksExpenses(expenseCollection.groupByDate()); } }
CurrentWeekExpensePresenter { public void renderCurrentWeeksExpenses() { view.displayCurrentWeeksExpenses(expenseCollection.groupByDate()); } CurrentWeekExpensePresenter(ExpenseDatabaseHelper database, CurrentWeekExpenseView view); }
CurrentWeekExpensePresenter { public void renderCurrentWeeksExpenses() { view.displayCurrentWeeksExpenses(expenseCollection.groupByDate()); } CurrentWeekExpensePresenter(ExpenseDatabaseHelper database, CurrentWeekExpenseView view); void renderTotalExpenses(); void renderCurrentWeeksExpenses(); }
CurrentWeekExpensePresenter { public void renderCurrentWeeksExpenses() { view.displayCurrentWeeksExpenses(expenseCollection.groupByDate()); } CurrentWeekExpensePresenter(ExpenseDatabaseHelper database, CurrentWeekExpenseView view); void renderTotalExpenses(); void renderCurrentWeeksExpenses();  }