@@ -0,0 +1,2497 @@
+package io.github.plastix.forage.ui;%0A%0Aimport android.annotation.SuppressLint;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.experimental.runners.Enclosed;%0Aimport org.junit.runner.RunWith;%0A%0Aimport static com.google.common.truth.Truth.assertThat;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.verify;%0A%0A@RunWith(Enclosed.class) // Allows for multiple static inner classes with tests%0Apublic class PresenterFragmentTest %7B%0A%0A    /**%0A     * Mock the Fragment so we can test its lifecycle methods.%0A     */%0A    public static class MockedFragment %7B%0A%0A        private FakePresenterFragment presenterFragment;%0A        private FakePresenter fakePresenter;%0A%0A        @Before%0A        public void beforeEachTest() throws Exception %7B%0A            fakePresenter = new FakePresenter();%0A%0A            presenterFragment = mock(FakePresenterFragment.class);%0A            presenterFragment.setPresenter(fakePresenter);%0A        %7D%0A%0A        @Test%0A        public void onResume_shouldCallPresenterOnResume() %7B%0A            presenterFragment.onResume();%0A            verify(presenterFragment).onResume();%0A        %7D%0A%0A        @Test%0A        public void onPause_shouldCallPresenterOnPause() %7B%0A            presenterFragment.onPause();%0A            verify(presenterFragment).onPause();%0A        %7D%0A%0A        @Test%0A        public void onStart_shouldCallPresenterOnStart() %7B%0A            presenterFragment.onStart();%0A            verify(presenterFragment).onStart();%0A        %7D%0A%0A        @Test%0A        public void onStop_shouldCallPresenterOnStop() %7B%0A            presenterFragment.onStop();%0A            verify(presenterFragment).onStop();%0A        %7D%0A    %7D%0A%0A    /**%0A     * Don't mock the Fragment so we can test our custom logic.%0A     * Note that we can't call any Android methods here!%0A     */%0A    public static class UnMockedFragment %7B%0A%0A        @Test%0A        public void setPresenter_shouldAttachPresenter() %7B%0A            FakePresenterFragment presenterFragment = new FakePresenterFragment();%0A            FakePresenter fakePresenter = new FakePresenter();%0A%0A            presenterFragment.setPresenter(fakePresenter);%0A            assertThat(presenterFragment.presenter).isSameAs(fakePresenter);%0A        %7D%0A    %7D%0A%0A    private static class FakePresenter extends Presenter %7B%0A    %7D%0A%0A    @SuppressLint(%22ValidFragment%22)%0A    private static class FakePresenterFragment extends PresenterFragment%3CFakePresenter%3E %7B%0A        @Override%0A        protected int getFragmentLayout() %7B%0A            return 0;%0A        %7D%0A    %7D%0A%7D

Add PresenterFragment unit tests