Beispiel #1
0
        public ActionResult Delete(int tableOrderId)
        {
            TableOrder foundOrder = TableOrder.Find(tableOrderId);

            foundOrder.Delete();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public void Delete_DeletesOrderFromDatabase_EmptyList()
        {
            string     tableNumber = "4";
            DateTime   orderDate   = new DateTime(2019, 3, 12);
            TableOrder newOrder    = new TableOrder(tableNumber, orderDate);

            newOrder.Save();
            newOrder.Delete();
            List <TableOrder> testList = new List <TableOrder> {
            };
            List <TableOrder> result   = TableOrder.GetAll();

            CollectionAssert.AreEqual(testList, result);
        }