-
Notifications
You must be signed in to change notification settings - Fork 1k
Add unit test for RadioButtonStandardAdapter.cs, RadioButtonPopupAdapter.cs and RadioButtonFlatAdapter.cs files #13456
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
base: main
Are you sure you want to change the base?
Add unit test for RadioButtonStandardAdapter.cs, RadioButtonPopupAdapter.cs and RadioButtonFlatAdapter.cs files #13456
Conversation
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 a new unit test file for RadioButtonStandardAdapter, verifying its rendering methods for various RadioButton appearance settings.
- Adds tests for PaintUp, PaintDown, and PaintOver methods under different control appearances
- Covers both Appearance.Button and Appearance.Normal cases
Comments suppressed due to low confidence (2)
src/test/unit/System.Windows.Forms/System/Windows/Forms/RadioButtonStandardAdapterTests.cs:72
- [nitpick] The test method name 'PaintDown_AppearanceNormal_CallsPaintUp' may be misleading. If the intended behavior is for PaintDown to internally delegate to PaintUp on Appearance.Normal, consider clarifying the method name or adding a comment to explain this behavior.
public void PaintDown_AppearanceNormal_CallsPaintUp()
src/test/unit/System.Windows.Forms/System/Windows/Forms/RadioButtonStandardAdapterTests.cs:25
- [nitpick] Currently, the tests only verify that the control properties remain unchanged after the painting call. Consider adding assertions or additional verifications (such as inspecting the bitmap or using a graphics mock) to ensure that the adapter’s painting logic executes as expected.
adapter.PaintUp(e, CheckState.Checked);
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13456 +/- ##
====================================================
- Coverage 62.21083% 51.13003% -11.08081%
====================================================
Files 3213 2054 -1159
Lines 638302 286540 -351762
Branches 47201 41933 -5268
====================================================
- Hits 397093 146508 -250585
+ Misses 234153 137221 -96932
+ Partials 7056 2811 -4245
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
… and RadioButtonFlatAdapter.cs
Hey Olina, let's please wait with unit tests for Button- and ToolStripRenderers, until the DarkMode changes are ready. We would need to take a closer look anyway, since there are a few things, I need to investigate, which may have been regressed in the past. I'll follow up! |
Related #13442
Proposed changes