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 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()); }