在单元测试的Row属性中传递对象

时间:2012-07-05 01:21:36

标签: unit-testing c#-4.0 mbunit gallio

我正在尝试将一个对象与单元测试的Row属性中的其他参数一起传递。

    [Row("Test1", new CustomField(), 3)]  // parameters MUST be string, object and int    
    public void Test_Constructor(string testType, CustomField customField, int num)
    {
       .....
    }

但这会返回错误:

 An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type.

我该怎么做....

0 个答案:

没有答案