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); }
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); }
public void GetFilter_NotFoundForType_ReturnsNull() { Assert.Null(filters.GetFilter(typeof(Object), "equals")); }
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); }