添加到Kendo Grid中的Filters集合:C#单元测试

时间:2014-04-11 15:02:16

标签: c# unit-testing kendo-grid kendo-asp.net-mvc

我正在尝试在Kendo Grid上单元测试过滤器,但是当我添加过滤器时,过滤器集合为空。如何设置过滤器,以便在添加到集合时它们不为空?

以下是相关代码。

    var kendoDataRequest = new DataSourceRequest();
    var filter = new FilterDescriptor {Member = "test", Value = "test"};
    kendoDataRequest.Filters.Add(filter);

谢谢!

1 个答案:

答案 0 :(得分:0)

类似的东西:

var kendoDataRequest = new DataSourceRequest();
var filter = new FilterDescriptor {Member = "test", Value = "test"};

kendoDataRequest.Filters = new List<IFilterDescriptor>();

kendoDataRequest.Filters.Add(filter);