### Question:
ConfirmDispenseAdapter extends ArrayAdapter<DispensingItem> { @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(LAYOUT_INFLATER_SERVICE); View rowView = inflater.inflate(R.layout.confirm_commodity_list_item, parent, false); TextView textViewSOH = (TextView) rowView.findViewById(R.id.textViewSOH); TextView textViewCommodityName = (TextView) rowView.findViewById(R.id.textViewCommodityName); DispensingItem item = getItem(position); textViewCommodityName.setText(item.getCommodity().getName()); textViewSOH.setText(String.valueOf(item.getQuantity())); return rowView; } ConfirmDispenseAdapter(Context context, int resource, List<DispensingItem> items, Dispensing dispensing); @Override View getView(int position, View convertView, ViewGroup parent);  }### Answer:
@Test public void testQuantityWhenNotDispensingToFacility() throws Exception { ArrayList<DispensingItem> items = new ArrayList<>(); int quantity = 5; DispensingItem dispensingItem = new DispensingItem(commodity, quantity); items.add(dispensingItem); Dispensing dispensing = new Dispensing(); this.adapter = new ConfirmDispenseAdapter(Robolectric.application, R.layout.confirm_commodity_list_item, items, dispensing); View view = this.adapter.getView(0, null, parent); TextView soh = (TextView) view.findViewById(R.id.textViewSOH); assertThat(getIntFromString(soh.getText().toString()), is(quantity)); }