-
Notifications
You must be signed in to change notification settings - Fork 971
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 ItemTypeToolStripMenuItem #12199
base: main
Are you sure you want to change the base?
Add unit tests for ItemTypeToolStripMenuItem #12199
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12199 +/- ##
===================================================
+ Coverage 75.34760% 75.44109% +0.09349%
===================================================
Files 3099 3104 +5
Lines 634429 634340 -89
Branches 46874 46876 +2
===================================================
+ Hits 478027 478553 +526
+ Misses 152989 152360 -629
- Partials 3413 3427 +14
Flags with carried forward coverage won't be shown. Click here to find out more. |
...s.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ItemTypeToolStripMenuItemTests.cs
Outdated
Show resolved
Hide resolved
...s.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ItemTypeToolStripMenuItemTests.cs
Outdated
Show resolved
Hide resolved
...s.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ItemTypeToolStripMenuItemTests.cs
Outdated
Show resolved
Hide resolved
...s.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ItemTypeToolStripMenuItemTests.cs
Outdated
Show resolved
Hide resolved
[Fact] | ||
public void Dispose_SetsToolboxItemToNull() | ||
{ | ||
ItemTypeToolStripMenuItem item = new(typeof(string)); |
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.
This is a Component, please dispose it.
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.
In fact, you can factor out ItemTypeToolStripMenuItem
into a field and allocate it in the Test class constructor, make the test class an IDisposable
and dispose the item when the test class is disposed.
Related #10773
Proposed changes
Microsoft Reviewers: Open in CodeFlow