Chr*_*all 7 c# testing resharper nunit parameterized
我有一个测试类如下:
[TestFixture("someurl1", new[] { "param1", "param2" }, 15)]
[TestFixture("someurl2", new[] { "param3" }, 15)]
public class my_test
{
public my_test(string url, string[] fields, int someVal)
{
// test setup
}
}
Run Code Online (Sandbox Code Playgroud)
在ReSharper 6.1和NUnit 2.5.10中运行此测试时,测试不会按预期运行两次,它只运行一次.在测试结果我看到列出
my_test("someurl1", System.String[], 15)
Run Code Online (Sandbox Code Playgroud)
这让我认为两个灯具被视为相同,并且NUnit没有区分两个测试中的字符串数组.
作为一种解决方法,我在构造函数中添加了一个伪参数.如果我为每个灯具设置不同的值,则运行所有测试.
是否有可能让TestFixtures包含不同值的数组?我刚从ReSharper 5升级,所以我想知道这是否相关.我已经阅读了6.x中参数化测试的一些问题.
| 归档时间: |
|
| 查看次数: |
1747 次 |
| 最近记录: |