Example #1
0
        public void removeSaleFromStoreWithManagerPermission()
        {
            ProductInStore pis    = ProductManager.getInstance().getProductInStore(ss.addProductInStore("cola", 10, 4, zahi, store.getStoreId(), "Drink"));
            int            saleId = ss.addSaleToStore(aviad, store.getStoreId(), pis.getProductInStoreId(), 1, 3, DateTime.Now.AddYears(1).ToString());

            Assert.AreEqual(saleId, SalesManager.getInstance().getSalesByProductInStoreId(pis.getProductInStoreId()).First.Value.SaleId);
            ss.removeManagerPermission("removeSaleFromStore", store.getStoreId(), aviad.getUserName(), zahi);
            int deleted = ss.removeSaleFromStore(aviad, store.getStoreId(), saleId);

            Assert.AreEqual(deleted, -4);    //-4 dont have premition
        }
Example #2
0
 public void simpleRemoveSale()
 {
     Assert.AreEqual(ss.removeSaleFromStore(zahi, store.getStoreId(), colaSale.SaleId), 0);
     Assert.AreEqual(ss.viewSalesByStore(store.getStoreId()).Count, 0);
 }
 public void viewSaleByProductInStoreIdWithDelete()
 {
     ss.removeSaleFromStore(itamar, store, saleId);
     Assert.AreEqual(1, sell.viewSalesByProductInStoreId(cola).Count);
 }