Skip to content
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

Add unit tests for LinkUtilities #12647

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

Conversation

Olina-Zhang
Copy link
Member

@Olina-Zhang Olina-Zhang commented Dec 16, 2024

related #10453

Proposed changes

  • Add unit tests for LinkUtilities to test its GetIELinkBehavior and EnsureLinkFonts methods.
Microsoft Reviewers: Open in CodeFlow

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.

There are failing tests in the CI that need to be addressed.

@dotnet-policy-service dotnet-policy-service bot added the 📭 waiting-author-feedback The team requires more information from the author label Dec 17, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Dec 18, 2024
@Olina-Zhang
Copy link
Member Author

Olina-Zhang commented Dec 18, 2024

There are failing tests in the CI that need to be addressed.

I don't know why test scenarios failed, because all are passed in my local machine:
image

@Tanya-Solyanik Tanya-Solyanik added the 📭 waiting-author-feedback The team requires more information from the author label Dec 18, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Dec 19, 2024
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.04500%. Comparing base (a5281d9) to head (0396ff9).
Report is 16 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                  @@
##                main      #12647          +/-   ##
====================================================
- Coverage   97.03492%   76.04500%   -20.98992%     
====================================================
  Files           1182        3181        +1999     
  Lines         354561      639666      +285105     
  Branches        5411       47214       +41803     
====================================================
+ Hits          344048      486434      +142386     
- Misses          9724      149716      +139992     
- Partials         789        3516        +2727     
Flag Coverage Δ
Debug 76.04500% <100.00000%> (-20.98992%) ⬇️
integration 18.17541% <ø> (?)
production 49.84658% <ø> (?)
test 97.03149% <100.00000%> (-0.00343%) ⬇️
unit 47.04381% <ø> (?)

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

ricardobossan
ricardobossan previously approved these changes Dec 19, 2024
public void LinkUtilities_GetIELinkBehavior_ReturnsExpected(string? registryValue, LinkBehavior expectedBehavior)
{
// Set registry value if provided
RegistryKey? key = Registry.CurrentUser.CreateSubKey(LinkUtilities.IEMainRegPath);
Copy link
Member

Choose a reason for hiding this comment

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

Registry values are machine-wide singletons, multiple test cases might be accessing them at the same time. If we are changing these values, we have to move all tests that read and write them into a sequential collection. It will be hard to identify all tests that read these values behind the scenes. And we might miss that the future tests read this value going forward.
Instead of writing this key I would suggest to read it, and set the right expected LinkBehavior based on the key value.

@Tanya-Solyanik Tanya-Solyanik added the 📭 waiting-author-feedback The team requires more information from the author label Dec 20, 2024
@ricardobossan ricardobossan dismissed their stale review December 23, 2024 16:17

New comment to be addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📭 waiting-author-feedback The team requires more information from the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants