public void removeProductFromStoreWithManagerPermission() { ss.removeManagerPermission("removeProductFromStore", store.getStoreId(), "aviad", zahi); ProductInStore pis = ProductManager.getInstance().getProductInStore(ss.addProductInStore("cola", 10, 4, zahi, store.getStoreId(), "Drink")); ss.removeProductFromStore(store.getStoreId(), pis.getProductInStoreId(), aviad); Assert.AreEqual(1, store.getProductsInStore().Count); }
public void SimpleRemoveProduct() { us.login(zahi, "zahi", "123456"); int storeId = ss.createStore("abowim", zahi); Store s = StoreManagement.getInstance().getStore(storeId); int pisId = ss.addProductInStore("cola", 3.2, 10, zahi, storeId, "Drink"); ProductInStore pis = ProductManager.getInstance().getProductInStore(pisId); int result = ss.removeProductFromStore(s.storeId, pis.productInStoreId, zahi); Assert.IsTrue(result > -1); LinkedList <ProductInStore> LPIS = us.viewProductsInStores(); Assert.AreEqual(LPIS.Count, 0); }