-
Notifications
You must be signed in to change notification settings - Fork 1k
Add unit test for ButtonBaseAdapter.ColorOptions.cs file #13458
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 ButtonBaseAdapter.ColorOptions.cs file #13458
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13458 +/- ##
====================================================
+ Coverage 62.21083% 76.59248% +14.38164%
====================================================
Files 3213 3231 +18
Lines 638302 639286 +984
Branches 47201 47304 +103
====================================================
+ Hits 397093 489645 +92552
+ Misses 234153 146062 -88091
+ Partials 7056 3579 -3477
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
src/test/unit/System.Windows.Forms/System/Windows/Forms/ButtonBaseAdapterTests.cs
Outdated
Show resolved
Hide resolved
src/test/unit/System.Windows.Forms/System/Windows/Forms/ButtonBaseAdapterTests.cs
Outdated
Show resolved
Hide resolved
src/test/unit/System.Windows.Forms/System/Windows/Forms/ButtonBaseAdapterTests.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.
Pull Request Overview
This PR adds a new unit test file, ButtonBaseAdapterTests.cs, to improve test coverage for the ButtonStandardAdapter.cs file.
- Added multiple tests to validate ColorOptions behavior under different modes (default, non-SystemControl colors with high contrast on/off, and disabled states).
- Consolidates assertions for computed color values based on brightness and high contrast conditions.
src/test/unit/System.Windows.Forms/System/Windows/Forms/ButtonBaseAdapterTests.cs
Show resolved
Hide resolved
|
||
data.ButtonFace.Should().Be(backColor); | ||
data.ButtonShadow.Should().Be(ControlPaint.Dark(backColor)); | ||
data.ButtonShadowDark.Should().Be(ControlPaint.LightLight(backColor)); |
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.
[nitpick] In high contrast mode, ButtonShadowDark is expected to be ControlPaint.LightLight(backColor) instead of the usual DarkDark. Adding a comment to explain this deviation would improve clarity for future maintainers.
Copilot uses AI. Check for mistakes.
Related #13442
Proposed changes
Microsoft Reviewers: Open in CodeFlow