Repository navigation
Fix TheoryDataRow traits not discovered in UI theory discoverers - #183
Merged
Merged
Conversation
…rers Agent-Logs-Url: https://github.com/AArnott/Xunit.StaFact/sessions/b00e6d63-40fc-4cc3-84f5-e5f392d96777 Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix WpfTheory not discovering traits in tests
Fix TheoryDataRow traits not discovered in UI theory discoverers
Apr 24, 2026
AArnott
approved these changes
Apr 24, 2026
AArnott
marked this pull request as ready for review
April 24, 2026 14:22
AArnott
enabled auto-merge (squash)
April 24, 2026 14:24
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #183 +/- ##
=======================================
Coverage 83.55% 83.55%
=======================================
Files 36 36
Lines 742 742
Branches 64 64
=======================================
Hits 620 620
Misses 100 100
Partials 22 22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced Aug 24, 2026
This was referenced Sep 14, 2026
This was referenced Sep 21, 2026
This was referenced Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Traits set via
TheoryDataRow.WithTrait()were silently dropped during test discovery forWpfTheory,StaTheory,UITheory, andWinFormsTheory, causing--filter-traitto return zero tests.Root cause
Utilities.CreateTestCaseForDataRowcalled a privateGetTraits(testMethod)that only readtestMethod.Traits, ignoring traits on theITheoryDataRowitself.Fix
Sdk/Utilities.cs: ReplaceGetTraits(testMethod)withTestIntrospectionHelper.GetTraits(testMethod, dataRow)inCreateTestCaseForDataRow— the xunit-provided overload that merges method-level and data-row-level traits.Tests
Added
TheoryDataRowTraitsAreDiscoveredto each affected theory test class using:Running
-- --filter-trait "rowid=properties"now correctly discovers and runs these tests.