Skip to content

Added unit tests for low-coverage System.Windows.Forms classes - #14911

Open
Sathish-087 wants to merge 2 commits into
dotnet:mainfrom
Sathish-087:Fix_Issue_13442
Open

Added unit tests for low-coverage System.Windows.Forms classes#14911
Sathish-087 wants to merge 2 commits into
dotnet:mainfrom
Sathish-087:Fix_Issue_13442

Conversation

@Sathish-087

@Sathish-087 Sathish-087 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #13442

Proposed changes

  • Added 9 unit tests for RadioButtonFlatAdapter.
  • Added 11 unit tests for RadioButtonPopupAdapter.
  • Added 8 unit tests for ToolStrip.RestoreFocusMessageFilter.
  • Added 8 unit tests for HtmlHistory.
  • Covered paint operations (PaintUp, PaintDown, PaintOver) for radio button adapter implementations.
  • Added coverage for adapter creation and layout behavior validation.
  • Added tests for DPI-aware check size calculations and shadowed text behavior.
  • Added coverage for checked-state rendering and text/image rendering scenarios.
  • Added tests validating focus restoration and message filtering behavior in ToolStrip.RestoreFocusMessageFilter.
  • Added tests covering HtmlHistory navigation APIs (Back, Forward, Go), property accessors, argument validation, and disposal behavior.
  • Improved unit test coverage for low-coverage classes in the System.Windows.Forms namespace.

Customer Impact

  • Improves unit test coverage for several previously low-coverage System.Windows.Forms classes.
  • Increases confidence in rendering, layout, focus restoration, and HTML history navigation functionality.
  • Helps prevent regressions in public and protected virtual APIs across the tested components.

Regression?

  • No

Risk

  • Low (tests only, no product code changes)

Test methodology

  • Executed existing WinForms unit test suite.
  • Added and executed new unit tests for RadioButtonFlatAdapter.
  • Added and executed new unit tests for RadioButtonPopupAdapter.
  • Added and executed new unit tests for ToolStrip.RestoreFocusMessageFilter.
  • Added and executed new unit tests for HtmlHistory.

Accessibility testing

NA

Test environment(s)

  • Visual Studio (Test Explorer)
  • Windows
  • .NET 11
Microsoft Reviewers: Open in CodeFlow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure that classes in the System.Windows.Forms namespace have adequate unit test coverage

1 participant