public void removeDiscountWithManagerPermission() { ProductInStore pis = ProductManager.getInstance().getProductInStore(ss.addProductInStore("cola", 150, 100, zahi, store.getStoreId(), "Drink")); int saleId = ss.addSaleToStore(zahi, store.getStoreId(), pis.getProductInStoreId(), 1, 40, DateTime.Now.AddYears(1).ToString()); ss.removeManagerPermission("removeDiscount", store.getStoreId(), aviad.getUserName(), zahi); Assert.IsTrue(ss.addDiscount(pis, 10, DateTime.Now.AddDays(1).ToString(), aviad, store)); Boolean removed = ss.removeDiscount(pis, store, aviad); Assert.AreEqual(1, DiscountsManager.getInstance().getAllDiscounts().Count); Assert.AreEqual(false, removed); }
public void simpleRemoveDiscount() { Assert.IsTrue(ss.removeDiscount(cola, store, zahi)); Assert.AreEqual(colaSale.getPriceAfterDiscount(1), 10); }