示例#1
0
        public void Success_FindOrderById()
        {
            //Arrange
            int   index;
            int   max_index;
            Order order;
            Order result;

            //Act
            index     = 0;
            max_index = 100;

            while (index < max_index)
            {
                order = new Order
                {
                    Price     = 201.0,
                    IsShipped = true,
                    Username  = user.Username
                };

                db_order.CreateOrder(order);
                index++;
            }

            order  = db_order.FindOrderByPrice(201.0)[50];
            result = db_order.FindOrderById(order.Id);

            //Assert
            Assert.AreEqual(order.Username, result.Username);
        }
示例#2
0
 /// <summary>
 /// Finds an order by its id.
 /// </summary>
 /// <param name="id"></param>
 /// <returns>Order</returns>
 public Order FindById(int id)
 {
     return(db_order.FindOrderById(id));
 }