use of com.hannesdorfmann.mosby3.mvp.MvpPresenter in project mosby by sockeqwe.
the class ActivityMvpDelegateImplTest method dontKeepPresenter.
@Test
public void dontKeepPresenter() {
ActivityMvpDelegateImpl<MvpView, MvpPresenter<MvpView>> delegate = new ActivityMvpDelegateImpl<>(activity, callback, false);
startActivity(delegate, null, 1, 1, 1);
Bundle bundle = BundleMocker.create();
finishActivity(delegate, bundle, false, 1, true, false);
startActivity(delegate, bundle, 2, 2, 2);
finishActivity(delegate, bundle, false, 2, false, true);
}
use of com.hannesdorfmann.mosby3.mvp.MvpPresenter in project mosby by sockeqwe.
the class ActivityMvpDelegateImplTest method appStartWithScreenOrientationChangeAndFinallyFinishing.
@Test
public void appStartWithScreenOrientationChangeAndFinallyFinishing() {
ActivityMvpDelegateImpl<MvpView, MvpPresenter<MvpView>> delegate = new ActivityMvpDelegateImpl<>(activity, callback, true);
startActivity(delegate, null, 1, 1, 1);
Bundle bundle = BundleMocker.create();
finishActivity(delegate, bundle, true, 1, true, false);
startActivity(delegate, bundle, 1, 2, 2);
finishActivity(delegate, bundle, false, 1, false, true);
}
use of com.hannesdorfmann.mosby3.mvp.MvpPresenter in project mosby by sockeqwe.
the class PresenterManagerTest method putNullPresenterThrowsNullPointerExceptino.
@Test
public void putNullPresenterThrowsNullPointerExceptino() {
MvpPresenter presenter = Mockito.mock(MvpPresenter.class);
Activity activity = Mockito.mock(Activity.class);
Application application = Mockito.mock(Application.class);
Mockito.when(activity.getApplication()).thenReturn(application);
try {
PresenterManager.putPresenter(null, "123", presenter);
Assert.fail("Exception expected");
} catch (NullPointerException e) {
}
try {
PresenterManager.putPresenter(activity, null, presenter);
Assert.fail("Exception expected");
} catch (NullPointerException e) {
}
try {
PresenterManager.putPresenter(activity, "123", null);
Assert.fail("Exception expected");
} catch (NullPointerException e) {
}
}
use of com.hannesdorfmann.mosby3.mvp.MvpPresenter in project mosby by sockeqwe.
the class ActivityMvpViewStateDelegateImplTestNew method dontKeepPresenterAndViewState.
@Test
public void dontKeepPresenterAndViewState() {
ActivityMvpViewStateDelegateImpl<MvpView, MvpPresenter<MvpView>, ViewState<MvpView>> delegate = new ActivityMvpViewStateDelegateImpl<>(activity, callback, false);
startActivity(delegate, null, 1, 1, 1, 1, 1, 0, null, 0, 1, 0);
Bundle bundle = BundleMocker.create();
finishActivity(delegate, bundle, false, 1, true, false);
startActivity(delegate, bundle, 2, 2, 2, 2, 2, 0, null, 0, 2, 0);
finishActivity(delegate, bundle, false, 2, false, true);
}
use of com.hannesdorfmann.mosby3.mvp.MvpPresenter in project mosby by sockeqwe.
the class ActivityMvpViewStateDelegateImplTestNew method appStartFinishing.
@Test
public void appStartFinishing() {
ActivityMvpViewStateDelegateImpl<MvpView, MvpPresenter<MvpView>, ViewState<MvpView>> delegate = new ActivityMvpViewStateDelegateImpl<>(activity, callback, true);
startActivity(delegate, null, 1, 1, 1, 1, 1, 0, null, 0, 1, 0);
Bundle bundle = BundleMocker.create();
finishActivity(delegate, bundle, false, 1, false, true);
}
Aggregations