ReSharper 2026.1 Help

代码检查:NUnit.AutoFixture。 不兼容的参数类型或不正确的参数值。

此检查会报告其值与对应测试方法参数类型不兼容的 [InlineAutoData(...)] 参数。 当提供的值在语法上有效,但仍无法作为该参数类型被 AutoFixture 的 NUnit 集成使用时,也会出现此问题。

示例

属性数据与测试签名不匹配,因此测试用例具有误导性,并且在测试体运行前可能就会失败。

[Test] [InlineAutoData("100")] public void TestCount(int count) { }
[Test] [InlineAutoData(100)] public void TestCount(int count) { }
2026年 5月 8日