Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我怎么能在我的单元测试中传递一个对象?这是我的代码:
[Test] [Row( "test",5,new CustomField())] public void Test_Constructor(string type, int number, CustomField customField) { ..... }
它返回错误:属性参数必须是属性参数类型的常量表达式、typeof 表达式或数组创建表达式
您可以使用工厂:
http://gallio.org/wiki/doku.php?id=mbunit:data-driven_testing:factory