Ejemplo n.º 1
0
        /// <summary>
        /// Get a single order
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public HttpResponseMessage GetOrder(int orderId)
        {
            var orderItems = manageOrders.GetOrder(orderId);

            if (orderItems == null)
            {
                return(new HttpResponseMessage()
                {
                    Content = new StringContent("Customer Order Not Found")
                });
            }
            else
            {
                return(new HttpResponseMessage()
                {
                    Content = new StringContent(JsonConvert.SerializeObject(orderItems).ToString(), Encoding.UTF8, "application/json")
                });
            }
        }
Ejemplo n.º 2
0
        public void GetOrderTest()
        {
            OrderItems expected = orderManage.GetOrder(11);

            Assert.IsNotNull(expected);
        }