@Test @Ignore("not implemented yet") public void testSignUpError() throws Exception { mRepository.signUp("baldomero", "llegateligero"); verify(mEventBus).post(isA(ErrorSigningUpEvent.class)); }
@Override public void signUp(String email, String password) { if ("baldomero".equals(email) && "llegateligero".equals(password)) { new Handler().postDelayed(new Runnable() { @Override public void run() { mEventBus.post(new ErrorSigningInEvent("Error signing up")); } }, 2000); } else { new Handler().postDelayed(new Runnable() { @Override public void run() { mEventBus.post(new SignedUpEvent()); } }, 2000); } }
LoginFirebaseRepository implements LoginRepository { @Override public void signUp(String email, String password) { if ("baldomero".equals(email) && "llegateligero".equals(password)) { new Handler().postDelayed(new Runnable() { @Override public void run() { mEventBus.post(new ErrorSigningInEvent("Error signing up")); } }, 2000); } else { new Handler().postDelayed(new Runnable() { @Override public void run() { mEventBus.post(new SignedUpEvent()); } }, 2000); } } }
LoginFirebaseRepository implements LoginRepository { @Override public void signUp(String email, String password) { if ("baldomero".equals(email) && "llegateligero".equals(password)) { new Handler().postDelayed(new Runnable() { @Override public void run() { mEventBus.post(new ErrorSigningInEvent("Error signing up")); } }, 2000); } else { new Handler().postDelayed(new Runnable() { @Override public void run() { mEventBus.post(new SignedUpEvent()); } }, 2000); } } LoginFirebaseRepository(); @VisibleForTesting  LoginFirebaseRepository(EventBus eventBus); }
LoginFirebaseRepository implements LoginRepository { @Override public void signUp(String email, String password) { if ("baldomero".equals(email) && "llegateligero".equals(password)) { new Handler().postDelayed(new Runnable() { @Override public void run() { mEventBus.post(new ErrorSigningInEvent("Error signing up")); } }, 2000); } else { new Handler().postDelayed(new Runnable() { @Override public void run() { mEventBus.post(new SignedUpEvent()); } }, 2000); } } LoginFirebaseRepository(); @VisibleForTesting  LoginFirebaseRepository(EventBus eventBus); @Override void signIn(String email, String password); @Override void signUp(String email, String password); @Override void checkAuthenticated(); }
LoginFirebaseRepository implements LoginRepository { @Override public void signUp(String email, String password) { if ("baldomero".equals(email) && "llegateligero".equals(password)) { new Handler().postDelayed(new Runnable() { @Override public void run() { mEventBus.post(new ErrorSigningInEvent("Error signing up")); } }, 2000); } else { new Handler().postDelayed(new Runnable() { @Override public void run() { mEventBus.post(new SignedUpEvent()); } }, 2000); } } LoginFirebaseRepository(); @VisibleForTesting  LoginFirebaseRepository(EventBus eventBus); @Override void signIn(String email, String password); @Override void signUp(String email, String password); @Override void checkAuthenticated();  }