Skip to content

Conversation

Zheng-Li01
Copy link
Member

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

Related #10773

Proposed changes
Add unit test file: DesignerUtilsTests.cs for public methods & properties of the DesignerUtils.cs

Note: working on another PR for the remaining test case

Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.58686%. Comparing base (71a8e95) to head (39a5a37).
Report is 132 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13435         +/-   ##
===================================================
- Coverage   76.60371%   76.58686%   -0.01686%     
===================================================
  Files           3230        3253         +23     
  Lines         639097      641110       +2013     
  Branches       47289       47442        +153     
===================================================
+ Hits          489572      491006       +1434     
- Misses        145953      146450        +497     
- Partials        3572        3654         +82     
Flag Coverage Δ
Debug 76.58686% <100.00000%> (-0.01686%) ⬇️
integration 18.85583% <ø> (+0.06775%) ⬆️
production 51.01200% <ø> (+0.00097%) ⬆️
test 97.41258% <100.00000%> (+0.00847%) ⬆️
unit 48.45871% <ø> (+0.03964%) ⬆️

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.

@Zheng-Li01 Zheng-Li01 added the waiting-review This item is waiting on review by one or more members of team label May 9, 2025
@ricardobossan ricardobossan requested a review from Copilot May 9, 2025 21:45
Copilot

This comment was marked as outdated.

ricardobossan

This comment was marked as outdated.

@ricardobossan ricardobossan dismissed their stale review May 9, 2025 21:48

Copilot had a point

@ricardobossan ricardobossan added the waiting-author-feedback The team requires more information from the author label May 9, 2025
@Zheng-Li01 Zheng-Li01 removed the waiting-author-feedback The team requires more information from the author label May 12, 2025
ricardobossan
ricardobossan previously approved these changes May 12, 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 requested a review from Copilot June 16, 2025 08:13
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

This PR adds extensive unit tests to increase code coverage for public methods and properties in DesignerUtils.

  • Introduces tests covering theme styles application, container checks, generic type filtering, unique site name generation, bounds calculation, and text baseline computation.
  • Validates behavior for both expected results and exception throwing conditions.
Comments suppressed due to low confidence (1)

src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerUtilsTests.cs:540

  • The test method name 'GetTextBaseline_ShouldThrowNullNullException_WhenControlIsNull' contains a probable typo. Consider renaming it to 'GetTextBaseline_ShouldThrowNullReferenceException_WhenControlIsNull' to accurately reflect the expected exception.
public void GetTextBaseline_ShouldThrowNullNullException_WhenControlIsNull()

@LeafShi1 LeafShi1 removed the waiting-review This item is waiting on review by one or more members of team label Jun 16, 2025
@ricardobossan
Copy link
Member

ricardobossan commented Jun 18, 2025

All LGTM, except that the CI fails no matter how many times I attempt to re-run failed checks. What do you think @LeafShi1 @Epica3055 ?

Nevermind. The issues were addressed.

ricardobossan
ricardobossan previously approved these changes Jun 20, 2025
@Zheng-Li01 Zheng-Li01 added the waiting-review This item is waiting on review by one or more members of team label Jul 4, 2025
@LeafShi1 LeafShi1 self-requested a review July 4, 2025 05:46
@LeafShi1 LeafShi1 merged commit fbba7f4 into dotnet:main Jul 8, 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 Jul 8, 2025
@Zheng-Li01 Zheng-Li01 deleted the Add_code_coverage_for_DesignerUtils branch July 9, 2025 07:49
@github-actions github-actions bot locked and limited conversation to collaborators Aug 8, 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.

4 participants