public void removeCouponWithManagerPermission() { ProductInStore pis = ProductManager.getInstance().getProductInStore(ss.addProductInStore("cola", 150, 100, zahi, store.getStoreId(), "Drink")); Boolean added = ss.addCouponDiscount(aviad, store, "coupon", pis, 10, DateTime.Now.AddYears(1).ToString()); Assert.AreEqual(true, added); ss.removeManagerPermission("removeCoupon", store.getStoreId(), aviad.getUserName(), zahi); Assert.AreEqual(false, ss.removeCoupon(store, aviad, "coupon")); }
public void RemoveCouponWithNullStore() { Assert.IsFalse(ss.removeCoupon(null, zahi, "copun")); Coupon c = ca.getCoupon("copun", cola.getProductInStoreId()); Assert.AreEqual(c.DueDate, "20/6/2018"); Assert.AreEqual(c.CouponId, "copun"); Assert.AreEqual(c.Percentage, 10); }