Skip to content

Conversation

Zheng-Li01
Copy link
Member

@Zheng-Li01 Zheng-Li01 commented May 20, 2025

Related #13442

Proposed changes
Add unit test file: TabRendererTests.cs for public methods of the TabRenderer.cs

Microsoft Reviewers: Open in CodeFlow

@Zheng-Li01 Zheng-Li01 requested a review from a team as a code owner May 20, 2025 07:24
@Zheng-Li01 Zheng-Li01 added the waiting-review This item is waiting on review by one or more members of team label May 20, 2025
Copy link

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.59337%. Comparing base (5821493) to head (0fe109a).
Report is 88 commits behind head on main.

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     
Flag Coverage Δ
Debug 76.59337% <100.00000%> (+14.38253%) ⬆️
integration 18.50331% <ø> (-0.28548%) ⬇️
production 50.99944% <ø> (+32.21066%) ⬆️
test 97.41411% <100.00000%> (+0.00999%) ⬆️
unit 48.41134% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@Copilot Copilot AI left a 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 the IsSupported 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]

@dotnet-policy-service dotnet-policy-service bot added the waiting-author-feedback The team requires more information from the author label May 21, 2025
@dotnet-policy-service dotnet-policy-service bot removed the waiting-author-feedback The team requires more information from the author label May 21, 2025
ricardobossan
ricardobossan previously approved these changes May 21, 2025
Copy link
Member

@ricardobossan ricardobossan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@LeafShi1 LeafShi1 removed the waiting-review This item is waiting on review by one or more members of team label Jun 16, 2025
ricardobossan
ricardobossan previously approved these changes Jun 16, 2025
@ricardobossan ricardobossan added the waiting-review This item is waiting on review by one or more members of team label Jun 16, 2025
@LeafShi1 LeafShi1 merged commit aa719d1 into dotnet:main Jun 17, 2025
8 checks passed
@dotnet-policy-service dotnet-policy-service bot removed the waiting-review This item is waiting on review by one or more members of team label Jun 17, 2025
@Zheng-Li01 Zheng-Li01 deleted the Add_code_coverage_for_TabRenderer branch July 2, 2025 08:06
@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants