@Test public void testGetExpenses_obtainingEmptyExpensesList() { List<ExpenseModel> emptyExpenseModelList = new ArrayList<>(); when(mExpenseDao.getExpenses()).thenReturn(emptyExpenseModelList); mExpensesInboxPresenter.getExpenses(); verify(mExpenseDao).getExpenses(); verify(mExpensesInboxActivity).listExpenses(emptyExpenseModelList); }
@Test public void testGetExpenses_successfulObtainingExpensesList() { List<ExpenseModel> expenseModelList = getExpensesList(); when(mExpenseDao.getExpenses()).thenReturn(expenseModelList); mExpensesInboxPresenter.getExpenses(); verify(mExpenseDao).getExpenses(); verify(mExpensesInboxActivity).listExpenses(expenseModelList); }