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

Improve NuGetSdkResolver tests #4367

Merged
merged 2 commits into from
Dec 10, 2021
Merged

Conversation

jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Dec 9, 2021

Bug

Fixes: NuGet/Home#11442

Regression? Last working version:

Description

In preparation of improving the NuGetSdkResolver, the test coverage should be improved.

Changes:

  1. Simplify TryGetPathOfFileAbove() method in GlobalJsonReader and add unit tests
  2. Move warnings and errors to NuGetSdkLogger and add unit tests
  3. Rename test methods to conform with naming standards
  4. Add more tests for NuGetSdkResolver and GlobalJsonReader

PR Checklist

  • PR has a meaningful title

  • PR has a linked issue.

  • Described changes

  • Tests

    • Automated tests added
    • OR
    • Test exception
    • OR
    • N/A
  • Documentation

    • Documentation PR or issue filled
    • OR
    • N/A

{
// In MSBuild 15.9, the SdkResolverContext has an Interactive property. The value will be gotten through reflection so the MSBuild
// references do not need to be updated.
private static readonly PropertyInfo SdkResolverContextInteractivePropertyInfo = typeof(SdkResolverContext).GetRuntimeProperty("Interactive");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was removed because I added it before the corresponding change in MSBuild was available via a NuGet package. We've long since consumed a newer version that has the property so we don't need to use reflection anymore.

In preparation of improving the NuGetSdkResolver, the test coverage should be improved.

Fixes NuGet/Home#11442
@jeffkl jeffkl force-pushed the dev-jeffkl-improve-sdk-resolver-tests branch from 2485574 to 4e43152 Compare December 10, 2021 16:47
@jeffkl jeffkl merged commit 0a2795f into dev Dec 10, 2021
@jeffkl jeffkl deleted the dev-jeffkl-improve-sdk-resolver-tests branch December 10, 2021 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve NuGetSdkResolver tests
3 participants