public ActionResult Update(int tableOrderId, string tableNumber, DateTime orderDate) { TableOrder foundTableOrder = TableOrder.Find(tableOrderId); foundTableOrder.Edit(tableNumber, orderDate); return(RedirectToAction("Show")); }
public void Edit_EditsOrderInDatabase_Order() { string tableNumber = "4"; DateTime orderDate = new DateTime(2019, 3, 12); TableOrder newOrder = new TableOrder(tableNumber, orderDate); newOrder.Save(); string newTableNumber = "5"; DateTime newOrderDate = new DateTime(2019, 3, 5); newOrder.Edit(newTableNumber, newOrderDate); TableOrder testOrder = TableOrder.GetAll()[0]; Assert.AreEqual(newOrder, testOrder); }