JetBrains Rider 2025.1 Help

代码检查:NUnit。 最大范围值无法通过步长值到达。

如果 NUnit 的 参数中的最大值超出了测试参数类型的限制,测试将无法正常工作:

  • 在 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年 6月 24日