예제 #1
0
        public void OrderByDescendingPropertyTest()
        {
            var sorter = OdooSorter <OdooPartner> .OrderByDescending(x => x.Name);

            Assert.That(sorter.Order.Contains("DESC"));
            Assert.That(sorter.Order.Contains("name"));
        }
예제 #2
0
        public void ListPagingOrderByDescTest()
        {
            var service = new OdooService(Connection);

            var results  = service.List <OdooPartner>(OdooFilter <OdooPartner> .Where(x => true), OdooSorter <OdooPartner> .OrderByDescending(x => x.Id), 0, 2);
            var results2 = service.List <OdooPartner>(OdooFilter <OdooPartner> .Where(x => true), OdooSorter <OdooPartner> .OrderByDescending(x => x.Id), 2, 2);

            Assert.IsNotNull(results);
            Assert.That(results.Any());
            Assert.That(results.Count == 2);
            Assert.That(results.First().Id > results2.First().Id);

            Assert.IsNotNull(results2);
            Assert.That(results2.Any());
            Assert.That(results2.Count == 2);
        }