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 ItemTypeToolStripMenuItem #12199

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

Conversation

Syareel-Sukeri
Copy link
Contributor

@Syareel-Sukeri Syareel-Sukeri commented Sep 23, 2024

Related #10773

Proposed changes

  • Add unit test ItemTypeToolStripMenuItemTests.cs for public properties and method of the ItemTypeToolStripMenuItem.
  • Enable nullability in ItemTypeToolStripMenuItem.
Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.44109%. Comparing base (66894e2) to head (ddcaace).
Report is 30 commits behind head on main.

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     
Flag Coverage Δ
Debug 75.44109% <100.00000%> (+0.09349%) ⬆️
integration 17.96673% <0.00000%> (+0.03874%) ⬆️
production 48.83210% <100.00000%> (+0.15708%) ⬆️
test 97.02518% <100.00000%> (-0.00173%) ⬇️
unit 45.84161% <100.00000%> (+0.04859%) ⬆️

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

@Syareel-Sukeri Syareel-Sukeri added the waiting-review This item is waiting on review by one or more members of team label Sep 23, 2024
@Epica3055 Epica3055 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 Sep 25, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Sep 30, 2024
@Syareel-Sukeri Syareel-Sukeri added the waiting-review This item is waiting on review by one or more members of team label Sep 30, 2024
@lonitra lonitra 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 Sep 30, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Oct 1, 2024
[Fact]
public void Dispose_SetsToolboxItemToNull()
{
ItemTypeToolStripMenuItem item = new(typeof(string));
Copy link
Member

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.

Copy link
Member

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.

@Tanya-Solyanik Tanya-Solyanik added the 📭 waiting-author-feedback The team requires more information from the author label Oct 1, 2024
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