-
Notifications
You must be signed in to change notification settings - Fork 1k
Add unit tests for ParentControlDesigner #13173
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 ParentControlDesigner #13173
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13173 +/- ##
===================================================
+ Coverage 61.35261% 61.87079% +0.51818%
===================================================
Files 1547 1553 +6
Lines 158479 159088 +609
Branches 14751 14816 +65
===================================================
+ Hits 97231 98429 +1198
+ Misses 60545 59943 -602
- Partials 703 716 +13
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This pull request adds unit tests for ParentControlDesigner to validate its public properties and methods.
- Introduces ParentControlDesignerTests.cs with tests for snap lines, control parenting, glyph retrieval, and component initialization.
- Covers scenarios such as valid snap line collection, handling of null default values, and reparenting controls when applicable.
Comments suppressed due to low confidence (2)
src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ParentControlDesignerTests.cs:39
- [nitpick] Consider caching the cast of snapLines to a List in a local variable to improve readability and avoid repeated casts in the assertions.
((List<SnapLine>)snapLines).Should()
src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ParentControlDesignerTests.cs:144
- [nitpick] Hiding the base method 'Contains' with 'new' might be confusing for future maintainers; consider overriding the method or renaming this implementation to clarify its intent.
public new bool Contains(Control ctl)
...ndows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ParentControlDesignerTests.cs
Show resolved
Hide resolved
...ndows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ParentControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
...ndows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ParentControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
...ndows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ParentControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
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!
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.
Added one comment
...ndows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ParentControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
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