HeaderPresenter extends DefaultActivityLightCycle<HomeView> { @Override public void onCreate(HomeView homeView, @Nullable Bundle bundle) { if (dateProvider.isMorning()) { homeView.sayHello(R.string.good_morning); } else { homeView.sayHello(R.string.hello); } } @Inject  HeaderPresenter(DateProvider dateProvider); @Override void onCreate(HomeView homeView, @Nullable Bundle bundle);  }
@Test public void sayHelloWhenNotMorning() { HeaderPresenter presenter = new HeaderPresenter(new DateProvider() { @Override public boolean isMorning() { return false; } }); presenter.onCreate(view, Bundle.EMPTY); verify(view).sayHello(R.string.hello); }
@Test public void sayGoodMorning() { HeaderPresenter presenter = new HeaderPresenter(new DateProvider() { @Override public boolean isMorning() { return true; } }); presenter.onCreate(view, Bundle.EMPTY); verify(view).sayHello(R.string.good_morning); }