@Test public void ShouldPutADAValuesAsDefault_WhenSavingUser() throws Exception { presenter.onNextClicked("35", null, null, null, -1, null); verify(dbHandlerMock).addUser(userCaptor.capture()); final User user = userCaptor.getValue(); assertThat(user.getPreferred_unit_a1c()).isEqualTo("percentage"); assertThat(user.getPreferred_unit_weight()).isEqualTo("kilograms"); assertThat(user.getPreferred_range()).isEqualTo("ADA"); assertThat(user.getCustom_range_max()).isEqualTo(180); assertThat(user.getCustom_range_min()).isEqualTo(70); }
public void onNextClicked(String age, String gender, String language, String country, int type, String unit) { if (validateAge(age)) { saveToDatabase(id, name, language, country, Integer.parseInt(age), gender, type, unit); helloView.startMainView(); } else { helloView.displayErrorWrongAge(); } }
HelloPresenter { public void onNextClicked(String age, String gender, String language, String country, int type, String unit) { if (validateAge(age)) { saveToDatabase(id, name, language, country, Integer.parseInt(age), gender, type, unit); helloView.startMainView(); } else { helloView.displayErrorWrongAge(); } } }
HelloPresenter { public void onNextClicked(String age, String gender, String language, String country, int type, String unit) { if (validateAge(age)) { saveToDatabase(id, name, language, country, Integer.parseInt(age), gender, type, unit); helloView.startMainView(); } else { helloView.displayErrorWrongAge(); } } HelloPresenter(final HelloView helloView, final DatabaseHandler dbHandler); }
HelloPresenter { public void onNextClicked(String age, String gender, String language, String country, int type, String unit) { if (validateAge(age)) { saveToDatabase(id, name, language, country, Integer.parseInt(age), gender, type, unit); helloView.startMainView(); } else { helloView.displayErrorWrongAge(); } } HelloPresenter(final HelloView helloView, final DatabaseHandler dbHandler); void loadDatabase(); void onNextClicked(String age, String gender, String language, String country, int type, String unit); }
HelloPresenter { public void onNextClicked(String age, String gender, String language, String country, int type, String unit) { if (validateAge(age)) { saveToDatabase(id, name, language, country, Integer.parseInt(age), gender, type, unit); helloView.startMainView(); } else { helloView.displayErrorWrongAge(); } } HelloPresenter(final HelloView helloView, final DatabaseHandler dbHandler); void loadDatabase(); void onNextClicked(String age, String gender, String language, String country, int type, String unit);  }