Exemplo n.º 1
0
        public void do_override_sorting_if_no_sorting_exists()
        {
            var rule = SortRule <Case> .Ascending(x => x.Condition);

            var request = new GridDataRequest()
            {
                SortColumn    = null,
                SortAscending = false
            };

            rule.ApplyDefaultSorting(request);

            request.SortColumn.ShouldEqual("Condition");
            request.SortAscending.ShouldBeTrue();
        }
Exemplo n.º 2
0
        public void do_not_override_sorting_if_it_exists()
        {
            var rule = SortRule <Case> .Ascending(x => x.Condition);

            var request = new GridDataRequest()
            {
                SortColumn    = "different",
                SortAscending = false
            };

            rule.ApplyDefaultSorting(request);

            request.SortColumn.ShouldEqual("different");
            request.SortAscending.ShouldBeFalse();
        }
Exemplo n.º 3
0
 public void SortAscending(Expression <Func <TEntity, object> > property)
 {
     _definition.SortBy = SortRule <TEntity> .Ascending(property);
 }