// Path: app/src/test/java/com/andrey7mel/stepbystep/other/BaseTest.java
// @RunWith(RobolectricGradleTestRunner.class)
// @Config(application = TestApplication.class,
//         constants = BuildConfig.class,
//         sdk = 21)
// @Ignore
// public class BaseTest {
// 
//     public TestComponent component;
//     public TestUtils testUtils;
// 
//     @Before
//     public void setUp() throws Exception {
//         component = (TestComponent) App.getComponent();
//         testUtils = new TestUtils();
//     }
// 
// }
// 
// Path: app/src/test/java/com/andrey7mel/stepbystep/other/TestConst.java
// public class TestConst {
//     public static final String TEST_OWNER = "TEST_OWNER";
//     public static final String TEST_REPO = "TEST_REPO";
//     public static final String TEST_ERROR = "TEST_ERROR";
//     public static final String ERROR_RESPONSE_500 = "HTTP 500 OK";
//     public static final String ERROR_RESPONSE_404 = "HTTP 404 OK";
// 
// }
// 
// Path: app/src/main/java/com/andrey7mel/stepbystep/view/fragments/RepoListView.java
// public interface RepoListView extends View {
// 
//     void showRepoList(List<Repository> vo);
// 
//     void showEmptyList();
// 
//     String getUserName();
// 
//     void startRepoInfoFragment(Repository repository);
// 
// }
// 
// Path: app/src/main/java/com/andrey7mel/stepbystep/view/fragments/View.java
// public interface View {
// 
//     void showError(String error);
// 
//     void showLoading();
// 
//     void hideLoading();
// }


import com.andrey7mel.stepbystep.other.BaseTest;
import com.andrey7mel.stepbystep.other.TestConst;
import com.andrey7mel.stepbystep.view.fragments.RepoListView;
import com.andrey7mel.stepbystep.view.fragments.View;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import rx.Subscription;
import rx.observers.TestSubscriber;
import static junit.framework.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
        super.setUp();
        RepoListView repoListView = mock(RepoListView.class);
        basePresenter = new RepoListPresenter(repoListView);
        view = repoListView;
    }


    @Test
    public void testShowLoadingState() throws Exception {
        basePresenter.showLoadingState();
        verify(view).showLoading();
    }

    @Test
    public void testHideLoadingState() throws Exception {
        basePresenter.hideLoadingState();
        verify(view).hideLoading();
    }

    @Test
    public void testShowError() throws Exception {
        Throwable throwable = new Throwable(TestConst.TEST_ERROR);
        basePresenter.showError(throwable);
        verify(view).showError(TestConst.TEST_ERROR);
    }

    @Test
    public void testAddSubscription() throws Exception {
        Subscription test = new TestSubscriber<>();
        basePresenter.addSubscription(test);
// Path: app/src/test/java/com/andrey7mel/stepbystep/other/BaseTest.java
// @RunWith(RobolectricGradleTestRunner.class)
// @Config(application = TestApplication.class,
//         constants = BuildConfig.class,
//         sdk = 21)
// @Ignore
// public class BaseTest {
// 
//     public TestComponent component;
//     public TestUtils testUtils;
// 
//     @Before
//     public void setUp() throws Exception {
//         component = (TestComponent) App.getComponent();
//         testUtils = new TestUtils();
//     }
// 
// }
// 
// Path: app/src/test/java/com/andrey7mel/stepbystep/other/TestConst.java
// public class TestConst {
//     public static final String TEST_OWNER = "TEST_OWNER";
//     public static final String TEST_REPO = "TEST_REPO";
//     public static final String TEST_ERROR = "TEST_ERROR";
//     public static final String ERROR_RESPONSE_500 = "HTTP 500 OK";
//     public static final String ERROR_RESPONSE_404 = "HTTP 404 OK";
// 
// }
// 
// Path: app/src/main/java/com/andrey7mel/stepbystep/view/fragments/RepoListView.java
// public interface RepoListView extends View {
// 
//     void showRepoList(List<Repository> vo);
// 
//     void showEmptyList();
// 
//     String getUserName();
// 
//     void startRepoInfoFragment(Repository repository);
// 
// }
// 
// Path: app/src/main/java/com/andrey7mel/stepbystep/view/fragments/View.java
// public interface View {
// 
//     void showError(String error);
// 
//     void showLoading();
// 
//     void hideLoading();
// }


// Path: app/src/test/java/com/andrey7mel/stepbystep/presenter/BasePresenterTest.java
import com.andrey7mel.stepbystep.other.BaseTest;
import com.andrey7mel.stepbystep.other.TestConst;
import com.andrey7mel.stepbystep.view.fragments.RepoListView;
import com.andrey7mel.stepbystep.view.fragments.View;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import rx.Subscription;
import rx.observers.TestSubscriber;
import static junit.framework.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

        super.setUp();
        RepoListView repoListView = mock(RepoListView.class);
        basePresenter = new RepoListPresenter(repoListView);
        view = repoListView;
    }


    @Test
    public void testShowLoadingState() throws Exception {
        basePresenter.showLoadingState();
        verify(view).showLoading();
    }

    @Test
    public void testHideLoadingState() throws Exception {
        basePresenter.hideLoadingState();
        verify(view).hideLoading();
    }

    @Test
    public void testShowError() throws Exception {
        Throwable throwable = new Throwable(TestConst.TEST_ERROR);
        basePresenter.showError(throwable);
        verify(view).showError(TestConst.TEST_ERROR);
    }

    @Test
    public void testAddSubscription() throws Exception {
        Subscription test = new TestSubscriber<>();
        basePresenter.addSubscription(test);
        assertTrue(basePresenter.compositeSubscription.hasSubscriptions());