@Test public void shouldValidateFormReturnFalseWhenConsultationNumbersInvalid() throws Exception { presenter.rnRForm = createRnrForm(RnRForm.Emergency.No); when(VIARequisitionFragment.validateConsultationNumber()).thenReturn(false); boolean result = presenter.validateForm(); assertFalse(result); }
protected boolean validateForm() { if (rnRForm != null && rnRForm.isEmergency()) { return validateRnrFormItems(); } else { return view.validateConsultationNumber() && validateRnrFormItems(); } }
VIARequisitionPresenter extends BaseRequisitionPresenter { protected boolean validateForm() { if (rnRForm != null && rnRForm.isEmergency()) { return validateRnrFormItems(); } else { return view.validateConsultationNumber() && validateRnrFormItems(); } } }
VIARequisitionPresenter extends BaseRequisitionPresenter { protected boolean validateForm() { if (rnRForm != null && rnRForm.isEmergency()) { return validateRnrFormItems(); } else { return view.validateConsultationNumber() && validateRnrFormItems(); } } VIARequisitionPresenter(); }
VIARequisitionPresenter extends BaseRequisitionPresenter { protected boolean validateForm() { if (rnRForm != null && rnRForm.isEmergency()) { return validateRnrFormItems(); } else { return view.validateConsultationNumber() && validateRnrFormItems(); } } VIARequisitionPresenter(); @Override void loadData(long formId, Date periodEndDate); void loadEmergencyData(final List<StockCard> stockCards, final Date periodEndDate); @Override void attachView(BaseView baseView); void populateAdditionalDrugsViewModels(List<RnrFormItem> addedDrugInVIAs, Date periodBegin); void deleteRnRItemFromViewModel(final RnrFormItem rnrFormItem); @Override void updateUIAfterSubmit(); @Override void updateFormUI(); @Override void submitRequisition(); boolean processRequisition(String consultationNumbers); Observable<RnRForm> getSaveFormObservable(final String consultationNumbers); String getConsultationNumbers(); void setConsultationNumbers(String consultationNumbers); void createStockCardsOrUnarchiveAndAddToFormForAdditionalRnrItems(); Observable<Void> removeRnrItem(final RnrFormItem rnrFormItem); }
VIARequisitionPresenter extends BaseRequisitionPresenter { protected boolean validateForm() { if (rnRForm != null && rnRForm.isEmergency()) { return validateRnrFormItems(); } else { return view.validateConsultationNumber() && validateRnrFormItems(); } } VIARequisitionPresenter(); @Override void loadData(long formId, Date periodEndDate); void loadEmergencyData(final List<StockCard> stockCards, final Date periodEndDate); @Override void attachView(BaseView baseView); void populateAdditionalDrugsViewModels(List<RnrFormItem> addedDrugInVIAs, Date periodBegin); void deleteRnRItemFromViewModel(final RnrFormItem rnrFormItem); @Override void updateUIAfterSubmit(); @Override void updateFormUI(); @Override void submitRequisition(); boolean processRequisition(String consultationNumbers); Observable<RnRForm> getSaveFormObservable(final String consultationNumbers); String getConsultationNumbers(); void setConsultationNumbers(String consultationNumbers); void createStockCardsOrUnarchiveAndAddToFormForAdditionalRnrItems(); Observable<Void> removeRnrItem(final RnrFormItem rnrFormItem);  }