Exemplo n.º 1
0
        public void editSaleWithManagerPermission()
        {
            ProductInStore pis    = ProductManager.getInstance().getProductInStore(ss.addProductInStore("cola", 100, 100, zahi, store.getStoreId(), "Drink"));
            int            saleId = ss.addSaleToStore(zahi, store.getStoreId(), pis.getProductInStoreId(), 1, 40, DateTime.Now.AddYears(1).ToString());

            Assert.AreEqual(saleId, SalesManager.getInstance().getSalesByProductInStoreId(pis.getProductInStoreId()).First.Value.SaleId);
            ss.removeManagerPermission("editSale", store.getStoreId(), aviad.getUserName(), zahi);
            int edited = ss.editSale(aviad, store.getStoreId(), saleId, 30, DateTime.Now.AddYears(1).ToString());

            Assert.AreEqual(40, SalesManager.getInstance().getSale(saleId).Amount);
            Assert.AreEqual(edited, -4);    // -4 dont have premition
        }
Exemplo n.º 2
0
 public void simpleEditSale()
 {
     Assert.AreEqual(ss.editSale(zahi, store.getStoreId(), colaSale.SaleId, 5, "20/6/2018"), 0);
     Assert.AreEqual(colaSale.Amount, 5);
     Assert.AreEqual(colaSale.DueDate, "20/6/2018");
 }
Exemplo n.º 3
0
 public void SimpleEditSale()
 {
     ss.editSale(itamar, store.getStoreId(), saleId, 10, "15.2.2019");
     Assert.AreEqual(10, SalesManager.getInstance().getSale(saleId).Amount);
     Assert.AreEqual("15.2.2019", SalesManager.getInstance().getSale(saleId).DueDate);
 }