@Test public void shouldPopulateTextDataWhenPopulatingData() { viewModel.setRequested("999"); viewHolder.populate(viewModel); assertEquals("12345", viewHolder.etDocumentNo.getText().toString()); assertEquals("2011-11-11", viewHolder.txMovementDate.getText().toString()); assertEquals("", viewHolder.etReceived.getText().toString()); assertEquals("", viewHolder.etNegativeAdjustment.getText().toString()); assertEquals("", viewHolder.etPositiveAdjustment.getText().toString()); assertEquals("100", viewHolder.etIssued.getText().toString()); assertEquals("999", viewHolder.etRequested.getText().toString()); assertEquals("200", viewHolder.txStockExistence.getText().toString()); assertEquals("issue description", viewHolder.txReason.getText().toString()); }
public void populate(final StockMovementViewModel model) { txMovementDate.setText(model.getMovementDate()); etDocumentNo.setText(model.getDocumentNo()); etReceived.setText(model.getReceived()); etNegativeAdjustment.setText(model.getNegativeAdjustment()); etPositiveAdjustment.setText(model.getPositiveAdjustment()); etIssued.setText(model.getIssued()); etRequested.setText(model.getRequested()); txStockExistence.setText(model.getStockExistence()); txReason.setText(model.getReason().getDescription()); txSignature.setText(model.getSignature()); setItemViewTextColor(model); }
StockMovementItemHistoryViewHolder extends BaseViewHolder { public void populate(final StockMovementViewModel model) { txMovementDate.setText(model.getMovementDate()); etDocumentNo.setText(model.getDocumentNo()); etReceived.setText(model.getReceived()); etNegativeAdjustment.setText(model.getNegativeAdjustment()); etPositiveAdjustment.setText(model.getPositiveAdjustment()); etIssued.setText(model.getIssued()); etRequested.setText(model.getRequested()); txStockExistence.setText(model.getStockExistence()); txReason.setText(model.getReason().getDescription()); txSignature.setText(model.getSignature()); setItemViewTextColor(model); } }
StockMovementItemHistoryViewHolder extends BaseViewHolder { public void populate(final StockMovementViewModel model) { txMovementDate.setText(model.getMovementDate()); etDocumentNo.setText(model.getDocumentNo()); etReceived.setText(model.getReceived()); etNegativeAdjustment.setText(model.getNegativeAdjustment()); etPositiveAdjustment.setText(model.getPositiveAdjustment()); etIssued.setText(model.getIssued()); etRequested.setText(model.getRequested()); txStockExistence.setText(model.getStockExistence()); txReason.setText(model.getReason().getDescription()); txSignature.setText(model.getSignature()); setItemViewTextColor(model); } StockMovementItemHistoryViewHolder(View itemView); }
StockMovementItemHistoryViewHolder extends BaseViewHolder { public void populate(final StockMovementViewModel model) { txMovementDate.setText(model.getMovementDate()); etDocumentNo.setText(model.getDocumentNo()); etReceived.setText(model.getReceived()); etNegativeAdjustment.setText(model.getNegativeAdjustment()); etPositiveAdjustment.setText(model.getPositiveAdjustment()); etIssued.setText(model.getIssued()); etRequested.setText(model.getRequested()); txStockExistence.setText(model.getStockExistence()); txReason.setText(model.getReason().getDescription()); txSignature.setText(model.getSignature()); setItemViewTextColor(model); } StockMovementItemHistoryViewHolder(View itemView); void populate(final StockMovementViewModel model); }
StockMovementItemHistoryViewHolder extends BaseViewHolder { public void populate(final StockMovementViewModel model) { txMovementDate.setText(model.getMovementDate()); etDocumentNo.setText(model.getDocumentNo()); etReceived.setText(model.getReceived()); etNegativeAdjustment.setText(model.getNegativeAdjustment()); etPositiveAdjustment.setText(model.getPositiveAdjustment()); etIssued.setText(model.getIssued()); etRequested.setText(model.getRequested()); txStockExistence.setText(model.getStockExistence()); txReason.setText(model.getReason().getDescription()); txSignature.setText(model.getSignature()); setItemViewTextColor(model); } StockMovementItemHistoryViewHolder(View itemView); void populate(final StockMovementViewModel model);  }