public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); configuration.DB_MODE = testing; raffDB = new RaffleSaleDB(testing); li = new LinkedList <RaffleSale>(); raffDB.Add(new RaffleSale(1, "itamar", 500, "02/02/2020")); }
public Boolean addRaffleSale(int saleId, String userName, double offer, String dueDate) { RaffleSale toAdd = new RaffleSale(saleId, userName, offer, dueDate); ProductInStore pis = ProductManager.getInstance().getProductInStore(SalesManager.getInstance().getSale(saleId).ProductInStoreId); StoreRole sR = StoreRole.getStoreRole(pis.store, UserManager.getInstance().getUser(userName)); NotificationPublisher.getInstance().signToCategory(sR, NotificationPublisher.NotificationCategories.RaffleSale); RSDB.Add(toAdd); raffleSales.AddLast(toAdd); return(true); }
public void AddRaffleSale() { try { RaffleSale toAdd = new RaffleSale(2, "aviad", 100, "03/03/3000"); raffDB.Add(toAdd); li = raffDB.Get(); Assert.AreEqual(li.Count, 2); } catch (Exception e) { Assert.AreEqual(true, false, "there was a connection error to the testing db"); } }