@Test @Ignore public void shouldInVisibleWarningWhenUserChoseTheInventory() throws Exception { LMISTestApp.getInstance().setCurrentTimeMillis(100000); SingleClickButtonListener.isViewClicked = false; when(stockMovementRepository.listLastFiveStockMovements(anyLong())).thenReturn(newArrayList(new StockMovementItem())); when(stockMovementRepository.queryFirstStockMovementByStockCardId(anyLong())).thenReturn(new StockMovementItem()); when(stockRepository.list()).thenReturn(newArrayList(new StockCard())); selectPeriodActivity.refreshDate(inventoryList); shadowOf(selectPeriodActivity.vgContainer).performItemClick(2); assertThat(selectPeriodActivity.tvSelectPeriodWarning.getVisibility(), is(View.INVISIBLE)); Subscriber subscriber = new TestSubscriber(); Observable observable = selectPeriodActivity.presenter.correctDirtyObservable(Constants.Program.MMIA_PROGRAM); observable.subscribe(subscriber); selectPeriodActivity.nextBtn.performClick(); }
@Override public void refreshDate(List<SelectInventoryViewModel> inventories) { adapter.refreshDate(inventories); for (SelectInventoryViewModel selectInventoryViewModel : inventories) { if (selectInventoryViewModel.isChecked()) { int position = inventories.indexOf(selectInventoryViewModel); vgContainer.setItemChecked(position, true); selectedInventory = adapter.getItem(position); } } }
SelectPeriodActivity extends BaseActivity implements SelectPeriodPresenter.SelectPeriodView { @Override public void refreshDate(List<SelectInventoryViewModel> inventories) { adapter.refreshDate(inventories); for (SelectInventoryViewModel selectInventoryViewModel : inventories) { if (selectInventoryViewModel.isChecked()) { int position = inventories.indexOf(selectInventoryViewModel); vgContainer.setItemChecked(position, true); selectedInventory = adapter.getItem(position); } } } }
SelectPeriodActivity extends BaseActivity implements SelectPeriodPresenter.SelectPeriodView { @Override public void refreshDate(List<SelectInventoryViewModel> inventories) { adapter.refreshDate(inventories); for (SelectInventoryViewModel selectInventoryViewModel : inventories) { if (selectInventoryViewModel.isChecked()) { int position = inventories.indexOf(selectInventoryViewModel); vgContainer.setItemChecked(position, true); selectedInventory = adapter.getItem(position); } } }  }
SelectPeriodActivity extends BaseActivity implements SelectPeriodPresenter.SelectPeriodView { @Override public void refreshDate(List<SelectInventoryViewModel> inventories) { adapter.refreshDate(inventories); for (SelectInventoryViewModel selectInventoryViewModel : inventories) { if (selectInventoryViewModel.isChecked()) { int position = inventories.indexOf(selectInventoryViewModel); vgContainer.setItemChecked(position, true); selectedInventory = adapter.getItem(position); } } }  static Intent getIntentToMe(Context context, String programCode); static Intent getIntentToMe(Context context, String programCode, Period period); static Intent getIntentToMe(Context context, String programCode, boolean isMissedPeriod); static Intent getIntentToMe(Context context, String programCode, boolean isMissedPeriod, DateTime periodEnd); @Override void refreshDate(List<SelectInventoryViewModel> inventories); }
SelectPeriodActivity extends BaseActivity implements SelectPeriodPresenter.SelectPeriodView { @Override public void refreshDate(List<SelectInventoryViewModel> inventories) { adapter.refreshDate(inventories); for (SelectInventoryViewModel selectInventoryViewModel : inventories) { if (selectInventoryViewModel.isChecked()) { int position = inventories.indexOf(selectInventoryViewModel); vgContainer.setItemChecked(position, true); selectedInventory = adapter.getItem(position); } } }  static Intent getIntentToMe(Context context, String programCode); static Intent getIntentToMe(Context context, String programCode, Period period); static Intent getIntentToMe(Context context, String programCode, boolean isMissedPeriod); static Intent getIntentToMe(Context context, String programCode, boolean isMissedPeriod, DateTime periodEnd); @Override void refreshDate(List<SelectInventoryViewModel> inventories);  }