【发布时间】:2014-12-01 08:55:36
【问题描述】:
我有这样的测试:
[Test]
[TestCase(new RequestStatus?[] {RequestStatus.Created, null, RequestStatus.Complete, null})]
public void MyClass_MyMethod( RequestStatus?[] testCaseRequest )
{
...
}
Nuint 无法将 Nullable Array 识别为 TestCase 参数。我得到了这个:
属性参数必须是属性参数类型的常量表达式、typeof表达式或数组创建表达式
【问题讨论】:
-
您可能需要查看使用
TestCaseSource,如此处所述:stackoverflow.com/questions/19479817/… 和此处:stackoverflow.com/questions/10687091/… -
我在这里找到了答案:stackoverflow.com/questions/19479817/…
-
不错 :) 很高兴您解决了问题。
标签: c# arrays nunit nullable testcase