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
TUnit0004 rejects inherited property sources supplied by the derived test class #7551
An inherited property decorated with MethodDataSource("Rows") can resolve Rows on the derived test class during generated and reflection execution, but the analyzer reports TUnit0004 on the base property. This prevents compiling an otherwise supported data source.
Allow the derived test class to supply the property source, matching TestMetadataGenerator.GeneratePropertyDataSources and reflection execution. Currently TUnit0004 reports that the source method is missing at the base property.
Environment
Repository head a8babf9, SDK 10.0.403, macOS arm64. Found while validating #7547; its regression narrowly suppresses this diagnostic.
Acceptance criteria
The reproduction compiles without suppressing TUnit0004 when the inherited property source is supplied by the concrete derived test class.
Add analyzer regression coverage for this inherited-property case and retain diagnostics for genuinely missing data-source members.
Verify the inherited property receives the derived source value in generated and reflection execution.
Audited against main at 10a0af7. TestDataAnalyzer.AnalyzeProperty still passes propertySymbol.ContainingType (lines 86–87), and CheckMethodDataSource searches only that type and its bases before reporting TUnit0004 (lines 437–469). TestMetadataGenerator.GeneratePropertyDataSources instead passes the concrete test type when generating inherited property sources.
#7547 changes generator/converter discovery, not this analyzer, so it does not supersede or block this fix. Added acceptance criteria; this issue remains open and available for implementation.
Activity
thomhurst commentedon Nov 4, 2026
Audited against main at 10a0af7.
TestDataAnalyzer.AnalyzePropertystill passespropertySymbol.ContainingType(lines 86–87), andCheckMethodDataSourcesearches only that type and its bases before reporting TUnit0004 (lines 437–469).TestMetadataGenerator.GeneratePropertyDataSourcesinstead passes the concrete test type when generating inherited property sources.#7547 changes generator/converter discovery, not this analyzer, so it does not supersede or block this fix. Added acceptance criteria; this issue remains open and available for implementation.