JetBrains Rider 2025.2 Help

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

If the maximum value specified in the argument of the NUnit's Range Attribute is beyond the limit of the test parameter type, the test will not work properly:

  • 在 NUnit 2.x 中,超出范围的测试值将不会被执行。

  • 在 NUnit 3.x 中,测试将因 超出范围 错误而失败。

[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年 9月 26日