-
Notifications
You must be signed in to change notification settings - Fork 1k
Add code coverage for ListView.IconComparer #13485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add code coverage for ListView.IconComparer #13485
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new unit test suite for ListView.IconComparer
to validate its constructor, property setter, and comparison logic (including null handling).
- Introduces
ListView.IconComparerTests.cs
covering ascending/descending sort orders and null scenarios. - Ensures
Compare
returns correct sign for item text comparisons.
Comments suppressed due to low confidence (1)
src/test/unit/System.Windows.Forms/System/Windows/Forms/ListView.IconComparerTests.cs:40
- Add an
InlineData
case forSortOrder.None
in theCompare
theory to ensure behavior underNone
is covered.
public void Compare_ComparesListViewItems_ByText_AndSortOrder(SortOrder order, string text1, string text2, int expectedSign)
src/test/unit/System.Windows.Forms/System/Windows/Forms/ListView.IconComparerTests.cs
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13485 +/- ##
===================================================
+ Coverage 76.59589% 76.60627% +0.01037%
===================================================
Files 3230 3235 +5
Lines 639157 639321 +164
Branches 47295 47314 +19
===================================================
+ Hits 489568 489760 +192
+ Misses 146003 145987 -16
+ Partials 3586 3574 -12
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All LGTM!
Related #13442
Proposed changes
Microsoft Reviewers: Open in CodeFlow