-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add code coverage for DesignerUtils #13435
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 code coverage for DesignerUtils #13435
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13435 +/- ##
===================================================
- Coverage 76.60371% 76.58686% -0.01686%
===================================================
Files 3230 3253 +23
Lines 639097 641110 +2013
Branches 47289 47442 +153
===================================================
+ Hits 489572 491006 +1434
- Misses 145953 146450 +497
- Partials 3572 3654 +82
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.
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.
Pull Request Overview
This PR adds extensive unit tests to increase code coverage for public methods and properties in DesignerUtils.
- Introduces tests covering theme styles application, container checks, generic type filtering, unique site name generation, bounds calculation, and text baseline computation.
- Validates behavior for both expected results and exception throwing conditions.
Comments suppressed due to low confidence (1)
src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerUtilsTests.cs:540
- The test method name 'GetTextBaseline_ShouldThrowNullNullException_WhenControlIsNull' contains a probable typo. Consider renaming it to 'GetTextBaseline_ShouldThrowNullReferenceException_WhenControlIsNull' to accurately reflect the expected exception.
public void GetTextBaseline_ShouldThrowNullNullException_WhenControlIsNull()
...ystem.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerUtilsTests.cs
Outdated
Show resolved
Hide resolved
...ystem.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerUtilsTests.cs
Show resolved
Hide resolved
...ystem.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerUtilsTests.cs
Outdated
Show resolved
Hide resolved
...ystem.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerUtilsTests.cs
Outdated
Show resolved
Hide resolved
...ystem.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerUtilsTests.cs
Show resolved
Hide resolved
...ystem.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerUtilsTests.cs
Outdated
Show resolved
Hide resolved
...ystem.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerUtilsTests.cs
Outdated
Show resolved
Hide resolved
...ystem.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerUtilsTests.cs
Show resolved
Hide resolved
Nevermind. The issues were addressed. |
Related #10773
Proposed changes
Add unit test file: DesignerUtilsTests.cs for public methods & properties of the DesignerUtils.cs
Note: working on another PR for the remaining test case
Microsoft Reviewers: Open in CodeFlow