public void AddBuyHistory() { try { Purchase toAdd = new Purchase(2, 2, 2, "aviad", 50, "05/05/2050", 6, 2); buyHistoryDB.Add(toAdd); li = buyHistoryDB.Get(); Assert.AreEqual(li.Count, 2); } catch (Exception e) { Assert.AreEqual(true, false, "there was a connection error to the testing db"); } }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); configuration.DB_MODE = testing; buyHistoryDB = new BuyHistoryDB(testing); buyHistoryDB.Add(new Purchase(1, 1, 1, "itamar", 0.5, "02/02/2020", 5, 1)); li = new LinkedList <Purchase>(); }
public Boolean addBuyHistory(int productId, int storeId, String userName, double price, String date, int amount, int typeOfSale) { int buyId = getNextBuyId(); Purchase toAdd = new Purchase(buyId, productId, storeId, userName, price, date, amount, typeOfSale); BHDB.Add(toAdd); buysHistory.AddLast(toAdd); return(true); }