-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add unit tests for ToolStripKeyboardHandlingService.cs file #13896
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
base: main
Are you sure you want to change the base?
Add unit tests for ToolStripKeyboardHandlingService.cs file #13896
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13896 +/- ##
===================================================
+ Coverage 77.16116% 77.16767% +0.00651%
===================================================
Files 3273 3277 +4
Lines 644919 645164 +245
Branches 47694 47706 +12
===================================================
+ Hits 497627 497858 +231
- Misses 143607 143627 +20
+ Partials 3685 3679 -6
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
....Design/tests/UnitTests/System/Windows/Forms/Design/ToolStripKeyboardHandlingServiceTests.cs
Outdated
Show resolved
Hide resolved
{ | ||
TemplateNodeActive = false | ||
}; | ||
service.OnContextMenu(10, 10).Should().BeFalse(); |
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.
The actual part of the OnContextMenu
method is not tested.
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! Please consider initializing ToolStripKeyboardHandlingService once in the constructor instead of recreating it in every test. This would also allow converting some methods into expression-bodied members. When needed, you can adjust TemplateNodeActive after the service is instantiated.
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.
Thank you!
Related #10773
Proposed changes
Microsoft Reviewers: Open in CodeFlow