public void OrderByDescending_IEnumerable_OrdersCorrectly() { _customers = new List <Customer> { TestHelper.Bobby(), TestHelper.Billy(), TestHelper.Bobby(), }; var order = new CustomerTestOrder().ByNameDescending(); var result = _customers.NPredicateBuilderOrder(order); Assert.AreEqual("Billy", result.Last().Name); }
public void OrderBy_IQueryable_OrdersCorrectly() { _customers = new List <Customer> { TestHelper.Bobby(), TestHelper.Billy(), TestHelper.Bobby(), }; var order = new CustomerTestOrder().ByName(); var result = _customers.AsQueryable().NPredicateBuilderEFOrder(order); Assert.AreEqual("Billy", result.First().Name); }
public void ThenBy_IQueryable_OrdersCorrectly() { _customers = new List <Customer> { new Customer(Guid.NewGuid(), "Bobby", 30), new Customer(Guid.NewGuid(), "Billy", 30), new Customer(Guid.NewGuid(), "Billy", 20), }; var order = new CustomerTestOrder() .ByName() .ThenByAge(); var result = _customers.AsQueryable().NPredicateBuilderEFOrder(order); Assert.AreEqual("Billy", result.First().Name); Assert.AreEqual(20, result.First().Age); }
public void ThenByDescending_IEnumerable_OrdersCorrectly() { _customers = new List <Customer> { new Customer(Guid.NewGuid(), "Bobby", 30), new Customer(Guid.NewGuid(), "Billy", 30), new Customer(Guid.NewGuid(), "Billy", 20), }; var order = new CustomerTestOrder() .ByName() .ThenByAgeDescending(); var result = _customers.NPredicateBuilderOrder(order); Assert.AreEqual("Billy", result.First().Name); Assert.AreEqual(30, result.First().Age); }