Skip to content
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 unit tests for FocusableLabel #12773

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

chaowendy
Copy link
Contributor

@chaowendy chaowendy commented Jan 14, 2025

related #10453

Proposed changes

  • Add unit tests for FocusableLabel.cs to test its methods
Microsoft Reviewers: Open in CodeFlow

@chaowendy chaowendy requested a review from a team as a code owner January 14, 2025 03:15
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 76.13455%. Comparing base (4406e6e) to head (7b30da6).
Report is 48 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #12773         +/-   ##
===================================================
- Coverage   76.18076%   76.13455%   -0.04622%     
===================================================
  Files           3193        3233         +40     
  Lines         640306      642125       +1819     
  Branches       47237       47266         +29     
===================================================
+ Hits          487790      488879       +1089     
- Misses        148983      149699        +716     
- Partials        3533        3547         +14     
Flag Coverage Δ
Debug 76.13455% <92.00000%> (-0.04622%) ⬇️
integration 18.10723% <ø> (-0.05290%) ⬇️
production 50.07743% <ø> (-0.03646%) ⬇️
test 96.98566% <92.00000%> (-0.03747%) ⬇️
unit 47.51217% <ø> (-0.02665%) ⬇️

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

ricardobossan
ricardobossan previously approved these changes Jan 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.

All LGTM!

LeafShi1
LeafShi1 previously approved these changes Jan 16, 2025
@LeafShi1 LeafShi1 added the waiting-review This item is waiting on review by one or more members of team label Jan 16, 2025
@Tanya-Solyanik Tanya-Solyanik added waiting-author-feedback The team requires more information from the author and removed waiting-review This item is waiting on review by one or more members of team labels Jan 16, 2025
@ricardobossan ricardobossan dismissed their stale review January 16, 2025 19:00

New review added comments to be addressed

@dotnet-policy-service dotnet-policy-service bot removed the waiting-author-feedback The team requires more information from the author label Jan 23, 2025
@dotnet-policy-service dotnet-policy-service bot added the waiting-author-feedback The team requires more information from the author label Jan 23, 2025
@chaowendy chaowendy 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 Jan 26, 2025
@ricardobossan ricardobossan added waiting-author-feedback The team requires more information from the author and removed waiting-review This item is waiting on review by one or more members of team labels Jan 27, 2025

private class SubFocusableLabel : FocusableLabel
{
public CreateParams? CreateParams => base.CreateParams;
Copy link
Member

@ricardobossan ricardobossan Jan 27, 2025

Choose a reason for hiding this comment

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

As suggested in the failing checks:

src\System.Windows.Forms\tests\UnitTests\System\Windows\Forms\FocusableLabelTests.cs(37,30): error CS0114: (NETCORE_ENGINEERING_TELEMETRY=Build) 'FocusableLabelTests.SubFocusableLabel.CreateParams' hides inherited member 'FocusableLabel.CreateParams'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword.

Please add the new keyword to line 37:

public new CreateParams? CreateParams => base.CreateParams;

Comment on lines 47 to 48
.GetProperty("CreateParams", BindingFlags.NonPublic | BindingFlags.Instance)?
.GetValue(control);
Copy link
Member

Choose a reason for hiding this comment

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

Please indent lines 47 and 48.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-author-feedback The team requires more information from the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants