ALRequisitionPresenter extends BaseRequisitionPresenter { @Override public void updateFormUI() { if (rnRForm != null) { alReportViewModel = new ALReportViewModel(rnRForm); view.refreshRequisitionForm(rnRForm); view.setProcessButtonName(rnRForm.isDraft() ? context.getResources().getString(R.string.btn_submit) : context.getResources().getString(R.string.btn_complete)); } }  @Override void attachView(BaseView baseView); @Override void loadData(long formId, Date periodEndDate); @Override void updateUIAfterSubmit(); @Override void updateFormUI(); Observable<Void> getSaveFormObservable(); boolean isComplete(); void setViewModels(); public ALReportViewModel alReportViewModel; }
@Test public void shouldALViewArchFullDisplayed() { alRequisitionPresenter.rnRForm = createRnrForm(RnRForm.Emergency.No); alRequisitionPresenter.updateFormUI(); ALReportItemViewModel itemHF = alRequisitionPresenter.alReportViewModel.getItemHF(); ALReportItemViewModel itemCHW = alRequisitionPresenter.alReportViewModel.getItemCHW(); ALReportItemViewModel itemTotal = alRequisitionPresenter.alReportViewModel.getItemTotal(); assertThat(itemHF.getGridOne().getColumnCode(), is(ALGridViewModel.ALColumnCode.OneColumn)); assertThat(itemHF.getGridTwo().getColumnCode(), is(ALGridViewModel.ALColumnCode.TwoColumn)); assertThat(itemHF.getGridThree().getColumnCode(), is(ALGridViewModel.ALColumnCode.ThreeColumn)); assertThat(itemHF.getGridFour().getColumnCode(), is(ALGridViewModel.ALColumnCode.FourColumn)); assertThat(itemCHW.getGridOne().getColumnCode(), is(ALGridViewModel.ALColumnCode.OneColumn)); assertThat(itemCHW.getGridTwo().getColumnCode(), is(ALGridViewModel.ALColumnCode.TwoColumn)); assertThat(itemCHW.getGridThree().getColumnCode(), is(ALGridViewModel.ALColumnCode.ThreeColumn)); assertThat(itemCHW.getGridFour().getColumnCode(), is(ALGridViewModel.ALColumnCode.FourColumn)); assertThat(itemTotal.getGridOne().getColumnCode(), is(ALGridViewModel.ALColumnCode.OneColumn)); assertThat(itemTotal.getGridTwo().getColumnCode(), is(ALGridViewModel.ALColumnCode.TwoColumn)); assertThat(itemTotal.getGridThree().getColumnCode(), is(ALGridViewModel.ALColumnCode.ThreeColumn)); assertThat(itemTotal.getGridFour().getColumnCode(), is(ALGridViewModel.ALColumnCode.FourColumn)); }
@Test public void shouldALViewArchEmptyDisplayed() { alRequisitionPresenter.rnRForm = null; alRequisitionPresenter.updateFormUI(); assertNull(alRequisitionPresenter.alReportViewModel); }