Exemple #1
0
        public void GetCustomerOrder()
        {
            var customerId     = 1;
            var customerOrders = _service.GetCustomerOrder(customerId);

            Assert.IsTrue(customerOrders.Count() > 0);
        }
Exemple #2
0
        public async Task <IActionResult> GetOrder([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var order = _service.GetCustomerOrder(id);

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

            return(Ok(order));
        }