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

Utilize TypeName Parser API in ResXSerializationBinder #11312

Merged
merged 3 commits into from
May 6, 2024

Conversation

lonitra
Copy link
Member

@lonitra lonitra commented May 3, 2024

  • Utilize new TypeName parser API in ResXSerializationBinder where we had been manually picking apart the type name to redirect to/from .NET Framework type names
  • Add tests for ResXSerializationBinder to ensure behavior before/after is the same
Microsoft Reviewers: Open in CodeFlow

@lonitra lonitra requested a review from a team as a code owner May 3, 2024 17:31
@lonitra
Copy link
Member Author

lonitra commented May 3, 2024

cc: @adamsitnik

@lonitra lonitra changed the title Utilize TypeName Parser API Utilize TypeName Parser API in ResXSerializationBinder May 3, 2024
Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 91.01124% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 74.22294%. Comparing base (2d02446) to head (df10a81).
Report is 8 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #11312         +/-   ##
===================================================
- Coverage   74.35035%   74.22294%   -0.12742%     
===================================================
  Files           3019        3021          +2     
  Lines         626605      626146        -459     
  Branches       46604       46693         +89     
===================================================
- Hits          465883      464744       -1139     
- Misses        157321      158005        +684     
+ Partials        3401        3397          -4     
Flag Coverage Δ
Debug 74.22294% <91.01124%> (-0.12742%) ⬇️
integration 18.26985% <0.00000%> (-0.02879%) ⬇️
production 46.87860% <95.00000%> (-0.12865%) ⬇️
test 97.03871% <89.85507%> (-0.00469%) ⬇️
unit 43.83374% <95.00000%> (-0.12092%) ⬇️

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

Tanya-Solyanik
Tanya-Solyanik previously approved these changes May 3, 2024
typeName.Should().Be(typeName);
}

private class CustomTypeResolutionService : ITypeResolutionService
Copy link
Member

Choose a reason for hiding this comment

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

Consider giving this class a more descriptive name that would explain what is customization it has. I.e. this service is not only resolving the test types, but also tracks how they were resolved.

{
TypeName parsed = TypeName.Parse($"{typeof(Form).FullName}, {typeof(Form).Assembly.FullName}");
AssemblyNameInfo? assemblyNameInfo = parsed.AssemblyName;
_formNoVersionFullyQualifiedName = $"{typeof(Form).FullName}, {new AssemblyNameInfo(
Copy link
Member

Choose a reason for hiding this comment

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

You only need this string in one test, consider initializing it when needed only.

@lonitra lonitra merged commit 0f077e0 into dotnet:main May 6, 2024
8 checks passed
@lonitra lonitra deleted the typeparser branch May 6, 2024 23:59
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0 Preview5 milestone May 6, 2024
@alandryz83
Copy link

alandryz83 commented May 7, 2024 via email

@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants