@Test public void shouldSetAdapter() { InventoryViewModel inventoryViewModel = new UnpackKitInventoryViewModel(product); inventoryViewModel.setKitExpectQuantity(20); inventoryViewModel.setChecked(false); inventoryViewModel.setType("Embalagem"); inventoryViewModel.setStockOnHand(123L); LotMovementViewModel lotMovementViewModel = new LotMovementViewModelBuilder() .setMovementType(MovementReasonManager.MovementType.RECEIVE) .setQuantity("100") .setLotNumber("testLot").build(); inventoryViewModel.setExistingLotMovementViewModelList(newArrayList(lotMovementViewModel, lotMovementViewModel)); LotMovementAdapter existingLotMovementAdapter = new LotMovementAdapter(inventoryViewModel.getExistingLotMovementViewModelList(), inventoryViewModel.getProductName()); LotMovementAdapter newLotMovementAdapter = new LotMovementAdapter(inventoryViewModel.getExistingLotMovementViewModelList(), inventoryViewModel.getProductName()); viewHolder.populate(inventoryViewModel, action1); assertThat(existingLotMovementAdapter.getItemCount()).isEqualTo(2); assertThat(newLotMovementAdapter.getItemCount()).isEqualTo(2); }
public void populate(final InventoryViewModel viewModel, Action1 setConfirmNoStockReceivedAction) { this.viewModel = viewModel; lotListView.initLotListView(viewModel, getMovementChangedListener()); initViewHolderStyle(viewModel); setConfirmStockClickListener((UnpackKitInventoryViewModel) viewModel, setConfirmNoStockReceivedAction); validateIfShouldShowUpEmptyLotWarning(viewModel); updatePop(viewModel); }
UnpackKitWithLotViewHolder extends BaseViewHolder { public void populate(final InventoryViewModel viewModel, Action1 setConfirmNoStockReceivedAction) { this.viewModel = viewModel; lotListView.initLotListView(viewModel, getMovementChangedListener()); initViewHolderStyle(viewModel); setConfirmStockClickListener((UnpackKitInventoryViewModel) viewModel, setConfirmNoStockReceivedAction); validateIfShouldShowUpEmptyLotWarning(viewModel); updatePop(viewModel); } }
UnpackKitWithLotViewHolder extends BaseViewHolder { public void populate(final InventoryViewModel viewModel, Action1 setConfirmNoStockReceivedAction) { this.viewModel = viewModel; lotListView.initLotListView(viewModel, getMovementChangedListener()); initViewHolderStyle(viewModel); setConfirmStockClickListener((UnpackKitInventoryViewModel) viewModel, setConfirmNoStockReceivedAction); validateIfShouldShowUpEmptyLotWarning(viewModel); updatePop(viewModel); } UnpackKitWithLotViewHolder(View itemView); }
UnpackKitWithLotViewHolder extends BaseViewHolder { public void populate(final InventoryViewModel viewModel, Action1 setConfirmNoStockReceivedAction) { this.viewModel = viewModel; lotListView.initLotListView(viewModel, getMovementChangedListener()); initViewHolderStyle(viewModel); setConfirmStockClickListener((UnpackKitInventoryViewModel) viewModel, setConfirmNoStockReceivedAction); validateIfShouldShowUpEmptyLotWarning(viewModel); updatePop(viewModel); } UnpackKitWithLotViewHolder(View itemView); void populate(final InventoryViewModel viewModel, Action1 setConfirmNoStockReceivedAction); }
UnpackKitWithLotViewHolder extends BaseViewHolder { public void populate(final InventoryViewModel viewModel, Action1 setConfirmNoStockReceivedAction) { this.viewModel = viewModel; lotListView.initLotListView(viewModel, getMovementChangedListener()); initViewHolderStyle(viewModel); setConfirmStockClickListener((UnpackKitInventoryViewModel) viewModel, setConfirmNoStockReceivedAction); validateIfShouldShowUpEmptyLotWarning(viewModel); updatePop(viewModel); } UnpackKitWithLotViewHolder(View itemView); void populate(final InventoryViewModel viewModel, Action1 setConfirmNoStockReceivedAction);  }