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
Generic class without class rows: method [Arguments] row beside an IEnumerable<object> [MethodDataSource] runs on different instantiations per mode #7362
Take a generic test class with no class data source and a non-generic test method that has both an [Arguments] row inferring T and a [MethodDataSource] member of the test class declared as IEnumerable<object>:
The generator runs the [Arguments(1)] row on C<object> as well, although #7118 says a method row runs only on the instantiation it infers. Reflection drops the [MethodDataSource] rows entirely.
Expected
Both modes give the same result, with no row running on an instantiation it doesn't infer and no source silently disappearing. With a class [Arguments] row that infers no type (the core #7209 rule shipped in #7392), the intended comparison is C<int>.Run(1) and C<int>.Run(2), which is a reasonable target here as well.
Apply the same method-source instantiation rule in both modes, retaining both source values without duplicating the [Arguments] row on an unrelated instantiation.
Add a targeted TestProject fixture and a both-mode engine regression that asserts the exact test count, values, and closed class types.
Triage: added a native blocked_by #7209. The expected behavior follows #7209's rule, and PR #7337 changes the reflection [MethodDataSource] handling this issue touches. Fixing this first would conflict with that PR.
Removed the closed #7209 dependency after #7392 (ca4437c). This issue has no class data source; #7390 instead covers combinations beside a type-free class row. The no-class-row regression still needs its own reproduction and parity fix on current main.
Activity
thomhurst commentedon Nov 2, 2026
Triage: added a native blocked_by #7209. The expected behavior follows #7209's rule, and PR #7337 changes the reflection
[MethodDataSource]handling this issue touches. Fixing this first would conflict with that PR.thomhurst commentedon Nov 3, 2026
Removed the closed #7209 dependency after #7392 (ca4437c). This issue has no class data source; #7390 instead covers combinations beside a type-free class row. The no-class-row regression still needs its own reproduction and parity fix on current main.
thomhurst commentedon Nov 29, 2026
Partly fixed on #7883: both modes now agree, and nothing is dropped or duplicated.
Run(2)still runs onC<object>rather thanC<int>. Fixture: https://github.com/thomhurst/TUnit/tree/followup/class-row-repro-fixtures/tests/TUnit.TestProject/Bugs/_7362. Left for a follow-up PR.fix(generic): infer generic class types from member, typed and type-f…