public void Find_FindsSell_TransactionInDatabase_Sell_Transaction() { DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7); Sell_Transaction testSell_Transaction = new Sell_Transaction(1, 2, "a", dt, "b", 3, 0); testSell_Transaction.Save(); Sell_Transaction result = Sell_Transaction.Find(testSell_Transaction.GetId()); Assert.AreEqual(testSell_Transaction, result); }
public IActionResult Index() { Dictionary <string, object> dict = new Dictionary <string, object>(); List <Sell_Transaction> allSellTransactions = Sell_Transaction.GetAll(); List <Game> allGames = Game.GetAll(); dict.Add("allGames", allGames); dict.Add("allSellTransactions", allSellTransactions); ViewBag.Dictionary = dict; return(View("WantToBuy")); }
public void Delete_DeleteRemovesSell_Transaction_Sell_TransactionList() { DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7); Sell_Transaction testSell_Transaction = new Sell_Transaction(1, 2, "a", dt, "b", 3, 0); testSell_Transaction.Save(); testSell_Transaction.Delete(); List <Sell_Transaction> testList = new List <Sell_Transaction> { }; List <Sell_Transaction> result = Sell_Transaction.GetAll(); CollectionAssert.AreEqual(testList, result); }
public void Save_SavesToDatabase_Sell_TransactionList() { DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7); Sell_Transaction testSell_Transaction = new Sell_Transaction(1, 2, "a", dt, "b", 3, 0); testSell_Transaction.Save(); List <Sell_Transaction> result = Sell_Transaction.GetAll(); List <Sell_Transaction> testList = new List <Sell_Transaction> { testSell_Transaction }; CollectionAssert.AreEqual(testList, result); }
public ActionResult GameDetails(int id) { Dictionary <string, object> dict = new Dictionary <string, object>(); Sell_Transaction thisST = Sell_Transaction.Find(id); List <Game> allGames = Game.GetAll(); Game thisGame = Game.Find(thisST.GetGameId()); Game gameDetails = Game.Find(id); dict.Add("thisST", thisST); dict.Add("allGames", allGames); dict.Add("thisGame", thisGame); dict.Add("gameDetails", gameDetails); ViewBag.Dictionary = dict; return(View()); }
public void Edit_EditChangesSell_Transaction_Sell_Transaction() { DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7); DateTime dt2 = new DateTime(2008, 1, 2, 3, 4, 5); Sell_Transaction testSell_Transaction = new Sell_Transaction(1, 2, "a", dt, "b", 3, 0); testSell_Transaction.Save(); testSell_Transaction.Edit(4, 5, "c", dt2, "d", 6); Sell_Transaction result = Sell_Transaction.Find(testSell_Transaction.GetId()); Assert.AreEqual(4, result.GetGameId()); Assert.AreEqual(5, result.GetUserIdSeller()); Assert.AreEqual("c", result.GetStatus()); Assert.AreEqual(dt2, result.GetDate()); Assert.AreEqual("d", result.GetGamePhoto()); Assert.AreEqual(6, result.GetUserIdBuyer()); }
public void GetAll_DatabaseEmptyAtFirst_0() { int result = Sell_Transaction.GetAll().Count; Assert.AreEqual(0, result); }
public void Dispose() { Sell_Transaction.DeleteAll(); }