Exemplo n.º 1
0
        public void ListOrdersForGivenDate()
        {
            var datePlaced   = DateTime.MinValue;
            var ordersPlaced = _service.GetOrdersByDate(datePlaced);

            Assert.IsTrue(ordersPlaced.Count() > 0);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetOrderByDate([FromBody] DateTime orderDate)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var order = _service.GetOrdersByDate(orderDate);

            if (order == null)
            {
                return(NotFound());
            }

            return(Ok(order));
        }