コード例 #1
0
        public void TestAddOrder()
        {
            var ob = new OrderByBuilder();

            ob.AddOrder("contact.name", true);
            ob.AddOrder("contact.id", false);

            List <ArchiveOrderByInfo> result = ob.Get();

            Assert.Equal("contact.name", result[0].Name);
            Assert.Equal("contact.id", result[1].Name);
            Assert.Equal(OrderBySortType.ASC, result[0].Direction);
            Assert.Equal(OrderBySortType.DESC, result[1].Direction);
        }
コード例 #2
0
        public void TestAddOrderGeneric()
        {
            var ob = new OrderByBuilder();

            ob.AddOrder <TestPerson>("name", true);
            ob.AddOrder <TestPerson>("id", false);

            List <ArchiveOrderByInfo> result = ob.Get();

            Assert.Equal("testperson.name", result[0].Name);
            Assert.Equal("testperson.id", result[1].Name);
            Assert.Equal(OrderBySortType.ASC, result[0].Direction);
            Assert.Equal(OrderBySortType.DESC, result[1].Direction);
        }