Пример #1
0
        public void GetFilter_OnNotFoundValueTypeReturnsNull()
        {
            IGridColumn <GridModel> column = Substitute.For <IGridColumn <GridModel> >();
            Expression <Func <GridModel, Object> > expression = (model) => 0;

            column.Expression.Returns(expression);

            IGridFilter <GridModel> filter = filters.GetFilter <GridModel>(column, "Equals", "1");

            Assert.IsNull(filter);
        }
Пример #2
0
        public void GetFilter_NotMultiFilterable_SetsSecondFilterToNull()
        {
            column.Grid.Query        = HttpUtility.ParseQueryString("Grid-Name-Contains=a&Grid-Name-Equals=b&Grid-Name-Op=Or");
            column.IsMultiFilterable = false;

            Assert.Null(filters.GetFilter(column).Second);
        }
Пример #3
0
 public void GetFilter_NotFoundForType_ReturnsNull()
 {
     Assert.Null(filters.GetFilter(typeof(Object), "equals"));
 }
Пример #4
0
        public void GetFilter_NotMultiFilterable_SetsSecondFilterToNull(String name, String query)
        {
            column.Grid.Name         = name;
            column.IsMultiFilterable = false;
            column.Grid.Query        = HttpUtility.ParseQueryString(query);

            Assert.Null(filters.GetFilter(column).Second);
        }