public void loginClick() { // Update visual state onLoginStarted() // Delegate the actual work to the presenter presenter.login(email.getText().toString(), password.getText().toString); } private void onLoginStarted(){ loginButton.setEnabled(false); errors.setVisiblity(View.GONE); progress.setVisiblity(View.VISIBLE); } } Tes$ng Reac$ve MVP Applica$ons, Richard Cirerol
dependencies • Use Rx Scheduler hooks to replace the current Schedulers • Test all paths (onNext success, onNext failure, onError, doOnNext, etc.) Tes$ng Reac$ve MVP Applica$ons, Richard Cirerol
test (as well as a2er) • Prefer Schedulers.test() over Schedulers.immediate() • Can use Schedulers.immediate(), but YMMV • Don't use toBlocking() • If you use toBlocking(), make sure you add Fmeouts to your tests: @Test(timeout = 1000) Tes$ng Reac$ve MVP Applica$ons, Richard Cirerol
rate of the Observable stream. • TestSubscriber allows you to inspect a collec;on of items or errors from the Observable output Tes$ng Reac$ve MVP Applica$ons, Richard Cirerol