Skip to content

Conversation

MelonWang1
Copy link
Contributor

@MelonWang1 MelonWang1 commented May 20, 2025

Related #13442

Proposed changes

  • Add unit test file: ListView.IconComparerTests.cs for public methods of the ListView.IconComparer.cs.cs
Microsoft Reviewers: Open in CodeFlow

Copy link
Contributor

@Copilot Copilot AI left a 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 for SortOrder.None in the Compare theory to ensure behavior under None is covered.
public void Compare_ComparesListViewItems_ByText_AndSortOrder(SortOrder order, string text1, string text2, int expectedSign)

Copy link

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.60627%. Comparing base (ee29cfd) to head (747305c).
Report is 36 commits behind head on main.

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     
Flag Coverage Δ
Debug 76.60627% <100.00000%> (+0.01037%) ⬆️
integration 18.79192% <ø> (+0.00497%) ⬆️
production 51.02046% <ø> (+0.02150%) ⬆️
test 97.40051% <100.00000%> (-0.00361%) ⬇️
unit 48.41995% <ø> (+0.02009%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ricardobossan
ricardobossan previously approved these changes May 21, 2025
Copy link
Member

@ricardobossan ricardobossan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All LGTM!

@ricardobossan ricardobossan added the waiting-review This item is waiting on review by one or more members of team label May 22, 2025
@ricardobossan ricardobossan merged commit 264f309 into dotnet:main Jun 11, 2025
8 checks passed
@dotnet-policy-service dotnet-policy-service bot removed the waiting-review This item is waiting on review by one or more members of team label Jun 11, 2025
@MelonWang1 MelonWang1 deleted the Add_code_coverage_for_ListView.IconComparer branch June 13, 2025 07:04
@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants