Example #1
0
        public async Task TestGetOrderByCustomer()
        {
            OrderDataContext orderDataContext = new OrderDataContext(_connectionString);

            var custumer = new Customer
            {
                Id = 5
            };
            var orders = await orderDataContext.GetOrdersByCustomer(custumer);

            Assert.AreEqual(2, orders.Count);
        }
Example #2
0
        public async Task testGetOrdersByCustemers()
        {
            OrderDataContext orderDataContext = new OrderDataContext(_connectionString);
            var customer = new Customer()
            {
                Id      = 5,
                Country = "BR"
            };
            var orders = await orderDataContext.GetOrdersByCustomer(customer);

            Assert.AreEqual(2, orders.Count);
            Assert.AreEqual(1, orders[0].Items.Count);
            Assert.AreEqual(1, orders[1].Items.Count);
        }
Example #3
0
 public Task <IList <Order> > GetOrdersByCustomer(Customer customer)
 {
     return(_dbContext.GetOrdersByCustomer(customer));
 }