ReSharper 2026.1 Help

代码检查:NUnit.AutoFixture。 缺少 Test 或 TestFixture 属性。

当方法缺少 [Test] 且包含类也缺少 [TestFixture] 时,此检查会报告 AutoDataInlineAutoData 的用法。 在这种情况下,NUnit 不会将该方法视为可运行的测试。

添加缺失的 NUnit 特性后,测试将可被发现并执行。

示例

using AutoFixture.NUnit3; public sealed class AutoTest { [InlineAutoData] public void Test1(int x) { } }
using AutoFixture.NUnit3; using NUnit.Framework; public sealed class AutoTest { [Test] [InlineAutoData] public void Test1(int x) { } }

另一个可用的快速修复会将 [TestFixture] 添加到包含类中。

2026年 5月 8日