-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add code coverage for TabRenderer #13482
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 TabRenderer #13482
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13482 +/- ##
====================================================
+ Coverage 62.21083% 76.59337% +14.38253%
====================================================
Files 3213 3243 +30
Lines 638302 640152 +1850
Branches 47201 47389 +188
====================================================
+ Hits 397093 490314 +93221
+ Misses 234153 146314 -87839
+ Partials 7056 3524 -3532
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
Adds unit tests to verify that the TabRenderer
APIs in WinForms behave as expected and do not throw exceptions when drawing tabs and pages.
- Introduces
TabRendererTests
for theIsSupported
property - Covers all
DrawTabItem
overloads (basic, with text, with image, combined) - Adds a
DrawTabPage
test to confirm rendering changes pixel output
Comments suppressed due to low confidence (2)
src/test/unit/System.Windows.Forms/System/Windows/Forms/TabRendererTests.cs:4
- Missing using directives for Xunit and FluentAssertions; the test methods use [Fact], [WinFormsFact],
Should()
, and FluentAssertions APIs but these namespaces are not imported, which will cause compilation errors.
using System.Drawing;
src/test/unit/System.Windows.Forms/System/Windows/Forms/TabRendererTests.cs:15
- [nitpick] Consider guarding or skipping these rendering tests when visual styles are not enabled (
TabRenderer.IsSupported == false
), as drawing calls may become no-ops and result in flaky assertions on unsupported environments.
[WinFormsFact]
src/test/unit/System.Windows.Forms/System/Windows/Forms/TabRendererTests.cs
Outdated
Show resolved
Hide resolved
src/test/unit/System.Windows.Forms/System/Windows/Forms/TabRendererTests.cs
Outdated
Show resolved
Hide resolved
src/test/unit/System.Windows.Forms/System/Windows/Forms/TabRendererTests.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 #13442
Proposed changes
Add unit test file: TabRendererTests.cs for public methods of the TabRenderer.cs
Microsoft Reviewers: Open in CodeFlow