@Test public void shouldOnlyShowAdjustIconWhenAdjustmentQuantityIsNotZero() throws Exception { viewHolder.populate(viewModel, RnRForm.STATUS.DRAFT); assertThat(viewHolder.adjustTheoreticalIcon.getVisibility(), is(View.GONE)); viewModel.setAdjustmentViewModels(Arrays.asList(generateAdjustmentViewModel())); viewHolder.populate(viewModel, RnRForm.STATUS.DRAFT); assertThat(viewHolder.adjustTheoreticalIcon.getVisibility(), is(View.VISIBLE)); }
public void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status) { productCode.setText(entry.getFmn()); productName.setText(entry.getProductName()); initAmount.setText(entry.getInitAmount()); received.setText(entry.getReceived()); issued.setText(entry.getIssued()); theoreticalInventory.setText(entry.getTheoretical()); total.setText(entry.getTotal()); inventory.setText(entry.getInventory()); different.setText(entry.getDifferent()); totalRequest.setText(entry.getAdjustedTotalRequest()); populateAdjustmentTheoreticalIcon(entry); if (LMISApp.getInstance().getFeatureToggleFor(R.bool.feature_training)) { fakePopulateRequestApprovedAmount(entry, status); } else { populateRequestApprovedAmount(entry, status); } }
RequisitionFormViewHolder extends BaseViewHolder { public void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status) { productCode.setText(entry.getFmn()); productName.setText(entry.getProductName()); initAmount.setText(entry.getInitAmount()); received.setText(entry.getReceived()); issued.setText(entry.getIssued()); theoreticalInventory.setText(entry.getTheoretical()); total.setText(entry.getTotal()); inventory.setText(entry.getInventory()); different.setText(entry.getDifferent()); totalRequest.setText(entry.getAdjustedTotalRequest()); populateAdjustmentTheoreticalIcon(entry); if (LMISApp.getInstance().getFeatureToggleFor(R.bool.feature_training)) { fakePopulateRequestApprovedAmount(entry, status); } else { populateRequestApprovedAmount(entry, status); } } }
RequisitionFormViewHolder extends BaseViewHolder { public void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status) { productCode.setText(entry.getFmn()); productName.setText(entry.getProductName()); initAmount.setText(entry.getInitAmount()); received.setText(entry.getReceived()); issued.setText(entry.getIssued()); theoreticalInventory.setText(entry.getTheoretical()); total.setText(entry.getTotal()); inventory.setText(entry.getInventory()); different.setText(entry.getDifferent()); totalRequest.setText(entry.getAdjustedTotalRequest()); populateAdjustmentTheoreticalIcon(entry); if (LMISApp.getInstance().getFeatureToggleFor(R.bool.feature_training)) { fakePopulateRequestApprovedAmount(entry, status); } else { populateRequestApprovedAmount(entry, status); } } RequisitionFormViewHolder(View itemView); }
RequisitionFormViewHolder extends BaseViewHolder { public void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status) { productCode.setText(entry.getFmn()); productName.setText(entry.getProductName()); initAmount.setText(entry.getInitAmount()); received.setText(entry.getReceived()); issued.setText(entry.getIssued()); theoreticalInventory.setText(entry.getTheoretical()); total.setText(entry.getTotal()); inventory.setText(entry.getInventory()); different.setText(entry.getDifferent()); totalRequest.setText(entry.getAdjustedTotalRequest()); populateAdjustmentTheoreticalIcon(entry); if (LMISApp.getInstance().getFeatureToggleFor(R.bool.feature_training)) { fakePopulateRequestApprovedAmount(entry, status); } else { populateRequestApprovedAmount(entry, status); } } RequisitionFormViewHolder(View itemView); void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status); }
RequisitionFormViewHolder extends BaseViewHolder { public void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status) { productCode.setText(entry.getFmn()); productName.setText(entry.getProductName()); initAmount.setText(entry.getInitAmount()); received.setText(entry.getReceived()); issued.setText(entry.getIssued()); theoreticalInventory.setText(entry.getTheoretical()); total.setText(entry.getTotal()); inventory.setText(entry.getInventory()); different.setText(entry.getDifferent()); totalRequest.setText(entry.getAdjustedTotalRequest()); populateAdjustmentTheoreticalIcon(entry); if (LMISApp.getInstance().getFeatureToggleFor(R.bool.feature_training)) { fakePopulateRequestApprovedAmount(entry, status); } else { populateRequestApprovedAmount(entry, status); } } RequisitionFormViewHolder(View itemView); void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status);  }