public void addToProductQuantitySuccTest() { sr.addProduct(p); Assert.AreEqual("", sr.addToProductQuantity(p, 5)); Assert.AreEqual(15, p.getQuantityLeft()); }
public void addToProductQuantitySuccTest() { try { addProductSuccTest(); sr.addToProductQuantity(p, 5); Assert.AreEqual(15, p.getQuantityLeft()); } catch (Exception) { Assert.Fail(); } }
public void addToProductQuantity(int productid, int amount, Session session) { Product product = DBProduct.getInstance().getProductByID(productid); if (product == null) { throw new DoesntExistException("no such username"); } SubscribedUser user = session.getSubscribedUser(); StoreRole sr = DBStore.getInstance().getStoreRole(product.getStore(), user); sr.addToProductQuantity(product, amount); }