Beispiel #1
0
        public void addToProductQuantitySuccTest()
        {
            sr.addProduct(p);

            Assert.AreEqual("", sr.addToProductQuantity(p, 5));
            Assert.AreEqual(15, p.getQuantityLeft());
        }
Beispiel #2
0
        public void addToProductQuantitySuccTest()
        {
            try
            {
                addProductSuccTest();
                sr.addToProductQuantity(p, 5);

                Assert.AreEqual(15, p.getQuantityLeft());
            }
            catch (Exception) {
                Assert.Fail();
            }
        }
Beispiel #3
0
        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);
        }