Skip to content

Add code coverage for ListViewDesigner #13301

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

Merged

Conversation

Zheng-Li01
Copy link
Member

@Zheng-Li01 Zheng-Li01 commented Apr 14, 2025

Related #10773

Proposed changes

Add unit test file: ListViewDesignerrTests.cs for public methods & properties of the ListViewDesigner.cs

Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented Apr 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.55644%. Comparing base (1d61434) to head (653f524).
Report is 22 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13301         +/-   ##
===================================================
+ Coverage   62.19645%   62.55644%   +0.35999%     
===================================================
  Files           1556        1560          +4     
  Lines         159366      159675        +309     
  Branches       14854       14904         +50     
===================================================
+ Hits           99120       99887        +767     
+ Misses         59495       59019        -476     
- Partials         751         769         +18     
Flag Coverage Δ
Debug 62.55644% <100.00000%> (+0.35999%) ⬆️
integration 11.31915% <ø> (+0.01856%) ⬆️
production 40.72577% <ø> (+0.38926%) ⬆️
test 95.69057% <100.00000%> (+0.02333%) ⬆️
unit 38.12645% <ø> (+0.43402%) ⬆️

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.

@Zheng-Li01 Zheng-Li01 added the waiting-review This item is waiting on review by one or more members of team label Apr 14, 2025
@ricardobossan ricardobossan requested a review from Copilot April 15, 2025 18:22
Copy link

@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.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ListViewDesignerTests.cs:107

  • [nitpick] The test 'ListViewDesigner_Initialize_HooksChildHandles_WhenViewIsDetails' only asserts that the designer instance is not null, which does not verify that child handles are actually hooked. It is recommended to add assertions that check for specific properties or events that confirm the child handles have been hooked when the view is set to Details.
public void ListViewDesigner_Initialize_HooksChildHandles_WhenViewIsDetails()

src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ListViewDesignerTests.cs:117

  • [nitpick] The test 'ListViewDesigner_Initialize_DoesNotHookChildHandles_WhenViewIsNotDetails' only asserts that the designer instance is not null. It would be more effective to verify that no child handle-related actions occur when the view is not set to Details.
public void ListViewDesigner_Initialize_DoesNotHookChildHandles_WhenViewIsNotDetails()

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.

Other than small comments, LGTM!

@ricardobossan ricardobossan added the waiting-author-feedback The team requires more information from the author label Apr 15, 2025
@Tanya-Solyanik Tanya-Solyanik removed the waiting-review This item is waiting on review by one or more members of team label Apr 16, 2025
@Zheng-Li01 Zheng-Li01 added waiting-review This item is waiting on review by one or more members of team and removed waiting-author-feedback The team requires more information from the author labels Apr 16, 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.

Thank you!

Copy link
Contributor

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

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

Thank you! Nice catch that this file was in a wrong folder.

@Tanya-Solyanik Tanya-Solyanik merged commit d25bdee into dotnet:main Apr 16, 2025
8 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0 Preview4 milestone Apr 16, 2025
@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 Apr 16, 2025
@Zheng-Li01 Zheng-Li01 deleted the Add_code_coverage_for_ListViewDesigner branch April 17, 2025 00:57
@github-actions github-actions bot locked and limited conversation to collaborators May 17, 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