@Test @Ignore public void shouldSetEmergencyViewWhenRnrIsEmergency() { ((LMISTestApp) RuntimeEnvironment.application).setCurrentTimeMillis(DateUtil.parseString("2015-04-21 17:30:00 UTC", DateUtil.DATE_TIME_FORMAT).getTime()); RnRForm rnRForm = viaRequisitionFragment.presenter.getRnRForm(); rnRForm.setEmergency(true); viaRequisitionFragment.refreshRequisitionForm(rnRForm); viaRequisitionFragment.consultationView.findViewById(R.id.et_external_consultations_performed).performClick(); assertThat(ShadowToast.getTextOfLatestToast()).isEqualTo("This information is not used when creating an emergency requisition"); assertThat(((TextView) viaRequisitionFragment.kitView.findViewById(R.id.et_via_kit_received_hf)).getText().toString()).isEqualTo(StringUtils.EMPTY); assertThat(((TextView) viaRequisitionFragment.consultationView.findViewById(R.id.via_rnr_header)).getText()).isEqualTo("Emergency requisition balancete"); assertThat(viaRequisitionFragment.getActivity().getTitle().toString()).isEqualTo("Emergency requisition - 21 Apr"); }
@Override public void refreshRequisitionForm(RnRForm rnRForm) { bodyView.refresh(rnRForm); if (rnRForm.isEmergency()) { refreshEmergencyRnr(rnRForm); } else { refreshNormalRnr(rnRForm); } setEditable(); }
VIARequisitionFragment extends BaseReportFragment implements VIARequisitionView { @Override public void refreshRequisitionForm(RnRForm rnRForm) { bodyView.refresh(rnRForm); if (rnRForm.isEmergency()) { refreshEmergencyRnr(rnRForm); } else { refreshNormalRnr(rnRForm); } setEditable(); } }
VIARequisitionFragment extends BaseReportFragment implements VIARequisitionView { @Override public void refreshRequisitionForm(RnRForm rnRForm) { bodyView.refresh(rnRForm); if (rnRForm.isEmergency()) { refreshEmergencyRnr(rnRForm); } else { refreshNormalRnr(rnRForm); } setEditable(); }  }
VIARequisitionFragment extends BaseReportFragment implements VIARequisitionView { @Override public void refreshRequisitionForm(RnRForm rnRForm) { bodyView.refresh(rnRForm); if (rnRForm.isEmergency()) { refreshEmergencyRnr(rnRForm); } else { refreshNormalRnr(rnRForm); } setEditable(); }  @Override void onCreate(Bundle savedInstanceState); @Override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState); @Override void onViewCreated(View view, Bundle savedInstanceState); void hideOrShowAddProductMenuInVIAPage(); @Override void onCreateOptionsMenu(Menu menu, MenuInflater inflater); @Override boolean onOptionsItemSelected(MenuItem item); @Override void refreshRequisitionForm(RnRForm rnRForm); void setTitleWithPeriod(RnRForm rnRForm); @Override void highLightApprovedAmount(); @Override void highLightRequestAmount(); void setEditable(); @Override void showListInputError(int index); @NonNull Subscriber<RnRForm> getOnSavedSubscriber(); @Override void setProcessButtonName(String buttonName); @Override boolean validateConsultationNumber(); @NonNull @Override String getSignatureDialogTitle(); @Override void completeSuccess(); @Override void onActivityResult(int requestCode, int resultCode, Intent data); }
VIARequisitionFragment extends BaseReportFragment implements VIARequisitionView { @Override public void refreshRequisitionForm(RnRForm rnRForm) { bodyView.refresh(rnRForm); if (rnRForm.isEmergency()) { refreshEmergencyRnr(rnRForm); } else { refreshNormalRnr(rnRForm); } setEditable(); }  @Override void onCreate(Bundle savedInstanceState); @Override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState); @Override void onViewCreated(View view, Bundle savedInstanceState); void hideOrShowAddProductMenuInVIAPage(); @Override void onCreateOptionsMenu(Menu menu, MenuInflater inflater); @Override boolean onOptionsItemSelected(MenuItem item); @Override void refreshRequisitionForm(RnRForm rnRForm); void setTitleWithPeriod(RnRForm rnRForm); @Override void highLightApprovedAmount(); @Override void highLightRequestAmount(); void setEditable(); @Override void showListInputError(int index); @NonNull Subscriber<RnRForm> getOnSavedSubscriber(); @Override void setProcessButtonName(String buttonName); @Override boolean validateConsultationNumber(); @NonNull @Override String getSignatureDialogTitle(); @Override void completeSuccess(); @Override void onActivityResult(int requestCode, int resultCode, Intent data);  }