public void removeProductSuccTest() { sr.addProduct(p); Assert.AreEqual("", sr1.removeProduct(p)); Product returnP = DBProduct.getInstance().getProductByID(p.getProductID()); Assert.AreEqual(returnP, null); Assert.AreEqual(store.getProductList().Contains(p), false); }
public int addProduct(string productName, string productCategory, int price, int rank, int quantityLeft, int storeID, Session session) { DBStore storeDB = DBStore.getInstance(); Store store = storeDB.getStore(storeID); StoreRole sr = store.getStoreRole(session.getSubscribedUser()); Product product = new Product(productName, productCategory, price, rank, quantityLeft, store); sr.addProduct(product); return(product.getProductID()); }
public void addProductSuccTest() { Assert.AreEqual("", sr.addProduct(p)); Product returnP = DBProduct.getInstance().getProductByID(p.getProductID()); Assert.AreEqual(returnP, p); Assert.AreEqual(store.getProductList().Contains(p), true); }
public void addProductSuccTest() { try { sr.addProduct(p); Product returnP = DBProduct.getInstance().getProductByID(p.getProductID()); Assert.AreEqual(returnP, p); Assert.AreEqual(store.getProductList().Contains(p), true); } catch (Exception) { Assert.Fail(); } }