@Test public void shouldGetStockOutLevelWhenSOHIsZeroEvenAvgMonthlyConsumptionLessThanZero() throws LMISException { StockCard stockCard = new StockCard(); Product product = new Product(); stockCard.setProduct(product); stockCard.setAvgMonthlyConsumption(-1); viewModel.setStockCard(stockCard); viewModel.setStockOnHand(0); StockCardViewHolder.StockOnHandStatus stockOnHandLevel = viewModel.getStockOnHandLevel(); Assertions.assertThat(stockOnHandLevel).isEqualTo(StockCardViewHolder.StockOnHandStatus.STOCK_OUT); }
public StockOnHandStatus getStockOnHandLevel() { if (stockOnHand == 0) { return StockOnHandStatus.STOCK_OUT; } if (stockCard.getCMM() < 0) { return StockOnHandStatus.REGULAR_STOCK; } if (stockCard.isLowStock()) { return StockOnHandStatus.LOW_STOCK; } else if (stockCard.isOverStock()) { return StockOnHandStatus.OVER_STOCK; } return StockOnHandStatus.REGULAR_STOCK; }
InventoryViewModel extends BaseStockMovementViewModel { public StockOnHandStatus getStockOnHandLevel() { if (stockOnHand == 0) { return StockOnHandStatus.STOCK_OUT; } if (stockCard.getCMM() < 0) { return StockOnHandStatus.REGULAR_STOCK; } if (stockCard.isLowStock()) { return StockOnHandStatus.LOW_STOCK; } else if (stockCard.isOverStock()) { return StockOnHandStatus.OVER_STOCK; } return StockOnHandStatus.REGULAR_STOCK; } }
InventoryViewModel extends BaseStockMovementViewModel { public StockOnHandStatus getStockOnHandLevel() { if (stockOnHand == 0) { return StockOnHandStatus.STOCK_OUT; } if (stockCard.getCMM() < 0) { return StockOnHandStatus.REGULAR_STOCK; } if (stockCard.isLowStock()) { return StockOnHandStatus.LOW_STOCK; } else if (stockCard.isOverStock()) { return StockOnHandStatus.OVER_STOCK; } return StockOnHandStatus.REGULAR_STOCK; } InventoryViewModel(StockCard stockCard);  InventoryViewModel(Product product); }
InventoryViewModel extends BaseStockMovementViewModel { public StockOnHandStatus getStockOnHandLevel() { if (stockOnHand == 0) { return StockOnHandStatus.STOCK_OUT; } if (stockCard.getCMM() < 0) { return StockOnHandStatus.REGULAR_STOCK; } if (stockCard.isLowStock()) { return StockOnHandStatus.LOW_STOCK; } else if (stockCard.isOverStock()) { return StockOnHandStatus.OVER_STOCK; } return StockOnHandStatus.REGULAR_STOCK; } InventoryViewModel(StockCard stockCard);  InventoryViewModel(Product product); SpannableStringBuilder getStyledName(); SpannableStringBuilder getStyleType(); SpannableStringBuilder getStyledUnit(); boolean validate(); static InventoryViewModel buildEmergencyModel(StockCard stockCard); StockOnHandStatus getStockOnHandLevel(); Long getLotListQuantityTotalAmount(); String getFormattedProductName(); String getFormattedProductUnit(); @Override boolean equals(Object object); @Override int hashCode(); @Override String toString(); }
InventoryViewModel extends BaseStockMovementViewModel { public StockOnHandStatus getStockOnHandLevel() { if (stockOnHand == 0) { return StockOnHandStatus.STOCK_OUT; } if (stockCard.getCMM() < 0) { return StockOnHandStatus.REGULAR_STOCK; } if (stockCard.isLowStock()) { return StockOnHandStatus.LOW_STOCK; } else if (stockCard.isOverStock()) { return StockOnHandStatus.OVER_STOCK; } return StockOnHandStatus.REGULAR_STOCK; } InventoryViewModel(StockCard stockCard);  InventoryViewModel(Product product); SpannableStringBuilder getStyledName(); SpannableStringBuilder getStyleType(); SpannableStringBuilder getStyledUnit(); boolean validate(); static InventoryViewModel buildEmergencyModel(StockCard stockCard); StockOnHandStatus getStockOnHandLevel(); Long getLotListQuantityTotalAmount(); String getFormattedProductName(); String getFormattedProductUnit(); @Override boolean equals(Object object); @Override int hashCode(); @Override String toString();  }