You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Untyped [Arguments(null)] method row on a generic class silently produces no test #7141
An untyped [Arguments(null)] method row on a generic test class, with nothing else to infer the class's type argument, produces zero tests in both source-gen and reflection modes. There is no diagnostic or failed test, so the test silently disappears.
Source gen: InferClassTypesFromMethodArguments in src/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs returns null for a null params array.
Reflection: InferClassTypeArgumentsFromMethodRow in src/TUnit.Engine/Discovery/ReflectionTestDataCollector.cs returns null for ArgumentsAttribute.IsNullValuesArray.
#7106 (PR #7111) chose this deliberately so that [Arguments(null)] does not break a where T : struct constraint (fixture NullArrayMethodRowOnConstrainedClass). The problem is that when no other row or [GenerateGenericTest] provides an instantiation, the row is dropped without any signal.
Reproduce
Add the class above to TUnit.TestProject, then run --treenode-filter "/*/<ns>/NullRowOnGenericClass/*" in either mode. Discovery finds 0 tests.
Expected
Either infer object, matching how a generic method treats [Arguments(null)] (#7120), when that satisfies the constraints, or report a clear diagnostic or failed test saying T cannot be inferred. Do the same in both modes.
Activity
fix(engine): run untyped [Arguments(null)] rows on generic classes in…