public void ShouldProcessAnOrder() { var orders1 = new OrderRepo(new OrderDetailRepo()).GetAll(); Assert.Equal(1, orders1.ToList().Count); _repo.Purchase(0); var orders2 = new OrderRepo(new OrderDetailRepo()).GetAll(); Assert.Equal(2, orders2.ToList().Count); }
public void ShouldProcessAnOrder() { using (OrderRepo orderRepo = new OrderRepo(new OrderDetailRepo())) { System.Collections.Generic.IEnumerable <Order> orders1 = orderRepo.GetAll(); Assert.Equal(1, orders1.ToList().Count); _repo.Purchase(0); using (OrderRepo orderRepo1 = new OrderRepo(new OrderDetailRepo())) { System.Collections.Generic.IEnumerable <Order> orders2 = orderRepo1.GetAll(); Assert.Equal(2, orders2.ToList().Count); } } }
public void ShouldProcessAnOrder() { using (OrderRepo orderRepo = new OrderRepo(new OrderDetailRepo())) { IEnumerable <Order> orders1 = orderRepo.GetAll(); Assert.Single(orders1.ToList()); _repo.Purchase(0); using (OrderRepo orderRepo1 = new OrderRepo(new OrderDetailRepo())) { IEnumerable <Order> orders2 = orderRepo1.GetAll(); Assert.Equal(2, orders2.ToList().Count); } } }