コード例 #1
0
        public void OrderByPropertyTest()
        {
            var sorter = OdooSorter <OdooPartner> .OrderBy(x => x.Name);

            Assert.That(sorter.Order.Contains("ASC"));
            Assert.That(sorter.Order.Contains("name"));
        }
コード例 #2
0
        public void ListPagingOrderByTest()
        {
            var service = new OdooService(Connection);

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

            Assert.IsNotNull(results);
            Assert.That(results.Any());
            Assert.That(results.Count == 2);


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