代码检查:NUnit。 最大范围值无法通过步长值到达。
如果在 NUnit 的 Range 属性 的 to 参数中指定的最大值超出了测试参数类型的限制,测试将无法正常运行:
在 NUnit 2.x 中,超出范围值的测试将不会被执行。
在 NUnit 3.x 中,测试将因
Out of range错误而失败。
[Test]
public void MyTest(
// In NUnit 2.x the test will be executed with '255' but not with '256'
[Range(0, 256, 5)] byte x)
{
// do something
}
最后修改日期: 2025年 12月 8日