@Test public void shouldDisplayRegimeThreeLine() { List<RegimenItemThreeLines> linesList = new ArrayList<>(); linesList.add(new RegimenItemThreeLines(0, getString(R.string.mmia_1stline))); linesList.add(new RegimenItemThreeLines(1, getString(R.string.mmia_2ndline))); linesList.add(new RegimenItemThreeLines(2, getString(R.string.mmia_3rdline))); form.setRegimenThreeLinesWrapper(linesList); mmiaRequisitionFragment.regimeWrap = regimeListWrap; mmiaRequisitionFragment.mmiaPatientInfoListView = mmiaPatientInfoListView; mmiaRequisitionFragment.refreshRequisitionForm(form); verify(regimeListWrap).deHighLightTotal(); verify(mmiaPatientInfoListView).deHighLightTotal(); assertThat(mmiaRequisitionFragment.tvMismatch.getVisibility()).isEqualTo(View.INVISIBLE); assertFalse(mmiaRequisitionFragment.mmiaRegimeThreeLineListView.isCompleted()); assertTrue(mmiaRequisitionFragment.mmiaRegimeThreeLineListView.hasEmptyField()); assertThat(mmiaRequisitionFragment.mmiaRegimeThreeLineListView.getDataList().size()).isEqualTo(3); assertThat(mmiaRequisitionFragment.mmiaRegimeThreeLineListView.getTotal(MMIARegimeThreeLineList.COUNTTYPE.PATIENTSAMOUNT)).isEqualTo(0); }
@Override public void refreshRequisitionForm(RnRForm form) { scrollView.setVisibility(View.VISIBLE); List<RegimenItemThreeLines> regimeTypes = form.getRegimenThreeLineListWrapper(); rnrFormList.initView(form.getRnrFormItemListWrapper(), !(regimeTypes != null && !regimeTypes.isEmpty())); if (regimeTypes != null && !regimeTypes.isEmpty()) { mmiaRegimeThreeLineListView.initView(mmiaRegimeThreeLineTotal, mmiaRegimeThreeLinePharmacy, regimeTypes); } else { mmiaThreaPeuticLayout.setVisibility(View.GONE); tvRegimeTotalPharmacy.setVisibility(View.GONE); tvTotalPharmacyTitle.setVisibility(View.GONE); } regimeWrap.initView(tvRegimeTotal, tvRegimeTotalPharmacy, tvTotalPharmacyTitle, presenter); mmiaPatientInfoListView.initView(form.getBaseInfoItemListWrapper()); InflateFreezeHeaderView(); getActivity().setTitle(getString(R.string.label_mmia_title, DateUtil.formatDateWithoutYear(form.getPeriodBegin()), DateUtil.formatDateWithoutYear(form.getPeriodEnd()))); etComment.setText(form.getComments()); highlightTotalDifference(); bindListeners(); }
MMIARequisitionFragment extends BaseReportFragment implements MMIARequisitionPresenter.MMIARequisitionView { @Override public void refreshRequisitionForm(RnRForm form) { scrollView.setVisibility(View.VISIBLE); List<RegimenItemThreeLines> regimeTypes = form.getRegimenThreeLineListWrapper(); rnrFormList.initView(form.getRnrFormItemListWrapper(), !(regimeTypes != null && !regimeTypes.isEmpty())); if (regimeTypes != null && !regimeTypes.isEmpty()) { mmiaRegimeThreeLineListView.initView(mmiaRegimeThreeLineTotal, mmiaRegimeThreeLinePharmacy, regimeTypes); } else { mmiaThreaPeuticLayout.setVisibility(View.GONE); tvRegimeTotalPharmacy.setVisibility(View.GONE); tvTotalPharmacyTitle.setVisibility(View.GONE); } regimeWrap.initView(tvRegimeTotal, tvRegimeTotalPharmacy, tvTotalPharmacyTitle, presenter); mmiaPatientInfoListView.initView(form.getBaseInfoItemListWrapper()); InflateFreezeHeaderView(); getActivity().setTitle(getString(R.string.label_mmia_title, DateUtil.formatDateWithoutYear(form.getPeriodBegin()), DateUtil.formatDateWithoutYear(form.getPeriodEnd()))); etComment.setText(form.getComments()); highlightTotalDifference(); bindListeners(); } }
MMIARequisitionFragment extends BaseReportFragment implements MMIARequisitionPresenter.MMIARequisitionView { @Override public void refreshRequisitionForm(RnRForm form) { scrollView.setVisibility(View.VISIBLE); List<RegimenItemThreeLines> regimeTypes = form.getRegimenThreeLineListWrapper(); rnrFormList.initView(form.getRnrFormItemListWrapper(), !(regimeTypes != null && !regimeTypes.isEmpty())); if (regimeTypes != null && !regimeTypes.isEmpty()) { mmiaRegimeThreeLineListView.initView(mmiaRegimeThreeLineTotal, mmiaRegimeThreeLinePharmacy, regimeTypes); } else { mmiaThreaPeuticLayout.setVisibility(View.GONE); tvRegimeTotalPharmacy.setVisibility(View.GONE); tvTotalPharmacyTitle.setVisibility(View.GONE); } regimeWrap.initView(tvRegimeTotal, tvRegimeTotalPharmacy, tvTotalPharmacyTitle, presenter); mmiaPatientInfoListView.initView(form.getBaseInfoItemListWrapper()); InflateFreezeHeaderView(); getActivity().setTitle(getString(R.string.label_mmia_title, DateUtil.formatDateWithoutYear(form.getPeriodBegin()), DateUtil.formatDateWithoutYear(form.getPeriodEnd()))); etComment.setText(form.getComments()); highlightTotalDifference(); bindListeners(); }  }
MMIARequisitionFragment extends BaseReportFragment implements MMIARequisitionPresenter.MMIARequisitionView { @Override public void refreshRequisitionForm(RnRForm form) { scrollView.setVisibility(View.VISIBLE); List<RegimenItemThreeLines> regimeTypes = form.getRegimenThreeLineListWrapper(); rnrFormList.initView(form.getRnrFormItemListWrapper(), !(regimeTypes != null && !regimeTypes.isEmpty())); if (regimeTypes != null && !regimeTypes.isEmpty()) { mmiaRegimeThreeLineListView.initView(mmiaRegimeThreeLineTotal, mmiaRegimeThreeLinePharmacy, regimeTypes); } else { mmiaThreaPeuticLayout.setVisibility(View.GONE); tvRegimeTotalPharmacy.setVisibility(View.GONE); tvTotalPharmacyTitle.setVisibility(View.GONE); } regimeWrap.initView(tvRegimeTotal, tvRegimeTotalPharmacy, tvTotalPharmacyTitle, presenter); mmiaPatientInfoListView.initView(form.getBaseInfoItemListWrapper()); InflateFreezeHeaderView(); getActivity().setTitle(getString(R.string.label_mmia_title, DateUtil.formatDateWithoutYear(form.getPeriodBegin()), DateUtil.formatDateWithoutYear(form.getPeriodEnd()))); etComment.setText(form.getComments()); highlightTotalDifference(); bindListeners(); }  @Override void onCreate(Bundle savedInstanceState); @Override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState); @Override void onViewCreated(View view, Bundle savedInstanceState); @Override void refreshRequisitionForm(RnRForm form); @NonNull Subscriber<Void> getOnSavedSubscriber(); @Override void showValidationAlert(); @Override void setProcessButtonName(String buttonName); @Override void completeSuccess(); @NonNull String getSignatureDialogTitle(); @Override void onActivityResult(int requestCode, int resultCode, Intent data); }
MMIARequisitionFragment extends BaseReportFragment implements MMIARequisitionPresenter.MMIARequisitionView { @Override public void refreshRequisitionForm(RnRForm form) { scrollView.setVisibility(View.VISIBLE); List<RegimenItemThreeLines> regimeTypes = form.getRegimenThreeLineListWrapper(); rnrFormList.initView(form.getRnrFormItemListWrapper(), !(regimeTypes != null && !regimeTypes.isEmpty())); if (regimeTypes != null && !regimeTypes.isEmpty()) { mmiaRegimeThreeLineListView.initView(mmiaRegimeThreeLineTotal, mmiaRegimeThreeLinePharmacy, regimeTypes); } else { mmiaThreaPeuticLayout.setVisibility(View.GONE); tvRegimeTotalPharmacy.setVisibility(View.GONE); tvTotalPharmacyTitle.setVisibility(View.GONE); } regimeWrap.initView(tvRegimeTotal, tvRegimeTotalPharmacy, tvTotalPharmacyTitle, presenter); mmiaPatientInfoListView.initView(form.getBaseInfoItemListWrapper()); InflateFreezeHeaderView(); getActivity().setTitle(getString(R.string.label_mmia_title, DateUtil.formatDateWithoutYear(form.getPeriodBegin()), DateUtil.formatDateWithoutYear(form.getPeriodEnd()))); etComment.setText(form.getComments()); highlightTotalDifference(); bindListeners(); }  @Override void onCreate(Bundle savedInstanceState); @Override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState); @Override void onViewCreated(View view, Bundle savedInstanceState); @Override void refreshRequisitionForm(RnRForm form); @NonNull Subscriber<Void> getOnSavedSubscriber(); @Override void showValidationAlert(); @Override void setProcessButtonName(String buttonName); @Override void completeSuccess(); @NonNull String getSignatureDialogTitle(); @Override void onActivityResult(int requestCode, int resultCode, Intent data); static final int REQUEST_FOR_CUSTOM_REGIME; }