Skip to content

Add unit test for WebBrowserUriTypeConverter.cs file #13523

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Philip-Wang01
Copy link
Contributor

@Philip-Wang01 Philip-Wang01 commented May 26, 2025

Related #13442

Proposed changes

  • Add unit test file: WebBrowserUriTypeConverterTests.cs for WebBrowserUriTypeConverter.cs file.
Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented May 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.64147%. Comparing base (5821493) to head (f7669bd).
Report is 21 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                  @@
##                main      #13523          +/-   ##
====================================================
+ Coverage   62.21083%   76.64147%   +14.43063%     
====================================================
  Files           3213        3231          +18     
  Lines         638302      639167         +865     
  Branches       47201       47295          +94     
====================================================
+ Hits          397093      489867       +92774     
+ Misses        234153      145720       -88433     
+ Partials        7056        3580        -3476     
Flag Coverage Δ
Debug 76.64147% <100.00000%> (+14.43063%) ⬆️
integration 18.88760% <ø> (+0.09881%) ⬆️
production 51.09826% <ø> (+32.30948%) ⬆️
test 97.40425% <100.00000%> (+0.00014%) ⬆️
unit 48.40522% <ø> (?)

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.

@LeafShi1 LeafShi1 self-requested a review May 27, 2025 07:55
Copy link

@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 pull request adds a new unit test file for the WebBrowserUriTypeConverter to enhance test coverage for converting different URI inputs. The key changes include tests for valid URI conversion, handling of empty strings, exception throwing on invalid URIs, and returning the same URI when already provided as a Uri.

Comments suppressed due to low confidence (1)

src/test/unit/System.Windows.Forms/System/Windows/Forms/WebBrowserUriTypeConverterTests.cs:43

  • [nitpick] Consider adding a test case for null input to verify that WebBrowserUriTypeConverter handles it appropriately.
Uri uri = new("http://www.microsoft.com/");

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.

Other than small comments, all LGTM!

@ricardobossan ricardobossan added waiting-author-feedback The team requires more information from the author waiting-review This item is waiting on review by one or more members of team labels May 27, 2025
@Philip-Wang01 Philip-Wang01 removed the waiting-author-feedback The team requires more information from the author label May 28, 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-test coverage waiting-review This item is waiting on review by one or more members of team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants