예제 #1
0
        public ActionResult Create(string tableNumber, DateTime orderDate)
        {
            TableOrder newOrder = new TableOrder(tableNumber, DateTime.Now);

            newOrder.Save();
            return(RedirectToAction("Show", new { tableOrderId = newOrder.GetId() }));
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }