Commit efafe21
committed
fix: Include class-level DependsOn attributes in generated test metadata
The GenerateDependencies method in TestMetadataGenerator was only collecting
[DependsOn] attributes from the test method. This caused class-level
[DependsOn] attributes to be ignored, meaning dependencies declared at the
class level were not being pulled in when filtering tests.
This fix adds methodSymbol.ContainingType.GetAttributes() to also capture
class-level DependsOn attributes, ensuring tests with class-level dependencies
are properly resolved and included when filtered.1 parent 16c3457 commit efafe21
2 files changed
Lines changed: 29 additions & 0 deletions
File tree
- TUnit.Core.SourceGenerator/Generators
- TUnit.TestProject
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2478 | 2478 | | |
2479 | 2479 | | |
2480 | 2480 | | |
| 2481 | + | |
2481 | 2482 | | |
2482 | 2483 | | |
2483 | 2484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
0 commit comments