public ActionResult Create(string tableNumber, DateTime orderDate) { TableOrder newOrder = new TableOrder(tableNumber, DateTime.Now); newOrder.Save(); return(RedirectToAction("Show", new { tableOrderId = newOrder.GetId() })); }
public void GetId_ReturnsId_Int() { int id = 0; string tableNumber = "4"; DateTime orderDate = new DateTime(2019, 3, 12); TableOrder newTableOrder = new TableOrder(tableNumber, orderDate, id); int result = newTableOrder.GetId(); Assert.AreEqual(result, id); }
public void Find_FindsOrderInDatabase_Order() { string tableNumber = "4"; DateTime orderDate = new DateTime(2019, 3, 12); TableOrder newOrder = new TableOrder(tableNumber, orderDate); newOrder.Save(); int id = newOrder.GetId(); TableOrder testOrder = TableOrder.Find(id); Assert.AreEqual(newOrder, testOrder); }