package ca.six.todo.statistics;


import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import ca.six.todo.data.Task;
import ca.six.todo.data.source.TasksDataSource;
import ca.six.todo.data.source.TasksRepository;
import static org.mockito.Mockito.verify;

import java.util.ArrayList;
import java.util.List;

public class StatisticsPresenterTest {
    @Mock TasksRepository repo;
    @Mock StatisticsContract.View view;
    @Captor ArgumentCaptor<TasksDataSource.LoadTasksCallback> captor;

    @Before
    public void setUp() {
        MockitoAnnotations.initMocks(this);
    }

    @Test
    public void loadTaskStatisticsSucc() {

    }

    @Test
    public void loadTaskStatisticsFail() {

    }

    @Test
    public void tasksIsEmpty_ShowEmptyUI() {

    }
}
@@ -369,16 +369,56 @@
 .verify;
+%0Aimport static org.mockito.Mockito.when;
 %0A%0Aimport
@@ -783,24 +783,551 @@
 icsSucc() %7B%0A
+        StatisticsPresenter presenter = new StatisticsPresenter(repo, view);%0A        presenter.start();%0A%0A        Task task1 = new Task(%221%22, %221%22, true);%0A        Task task2 = new Task(%222%22, %222%22, false);%0A        Task task3 = new Task(%223%22, %223%22, true);%0A        List%3CTask%3E taskList = new ArrayList%3C%3E();%0A        taskList.add(task1);%0A        taskList.add(task2);%0A        taskList.add(task3);%0A%0A        verify(repo).getTasks(captor.capture());%0A        captor.getValue().onTasksLoaded(taskList);%0A%0A        verify(view).showStatistics(1, 2);
 %0A    %7D%0A%0A    

write unit test code