Update tests for test templates #49145
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates the
DotnetNewTestTemplatesTests
integration tests to improve maintainability and align with current conventions. Key changes include replacing hardcoded framework values with dynamic ones, updating assertions for better readability, and refining comments for clarity.Updates to framework handling:
"net10.0"
) withToolsetInfo.CurrentTargetFramework
in theSupportedTargetFrameworks
array for dynamic framework compatibility. ([test/dotnet-new.IntegrationTests/DotnetNewTestTemplatesTests.csL14-R14](https://github.com/dotnet/sdk/pull/49145/files#diff-186c574a5e9e4f3f1c7f3d0a4456670c788b21f22232bf8767b4bf76c419b44bL14-R14)
)ToolsetInfo.CurrentTargetFrameworkVersion
instead of a hardcoded version string. ([test/dotnet-new.IntegrationTests/DotnetNewTestTemplatesTests.csL55-R55](https://github.com/dotnet/sdk/pull/49145/files#diff-186c574a5e9e4f3f1c7f3d0a4456670c788b21f22232bf8767b4bf76c419b44bL55-R55)
)Assertion improvements:
.Should().ExitWith(0)
with.Should().Pass()
in multiple test methods for improved readability and alignment with FluentAssertions conventions. ([[1]](https://github.com/dotnet/sdk/pull/49145/files#diff-186c574a5e9e4f3f1c7f3d0a4456670c788b21f22232bf8767b4bf76c419b44bL69-R69)
,[[2]](https://github.com/dotnet/sdk/pull/49145/files#diff-186c574a5e9e4f3f1c7f3d0a4456670c788b21f22232bf8767b4bf76c419b44bL86-R95)
,[[3]](https://github.com/dotnet/sdk/pull/49145/files#diff-186c574a5e9e4f3f1c7f3d0a4456670c788b21f22232bf8767b4bf76c419b44bL109-R109)
,[[4]](https://github.com/dotnet/sdk/pull/49145/files#diff-186c574a5e9e4f3f1c7f3d0a4456670c788b21f22232bf8767b4bf76c419b44bL132-R140)
,[[5]](https://github.com/dotnet/sdk/pull/49145/files#diff-186c574a5e9e4f3f1c7f3d0a4456670c788b21f22232bf8767b4bf76c419b44bL170-R178)
)Comment refinements:
ItemTemplate_CanBeInstalledAndTestArePassing
method to clarify the purpose and parameters of thedotnet new
command. ([test/dotnet-new.IntegrationTests/DotnetNewTestTemplatesTests.csL86-R95](https://github.com/dotnet/sdk/pull/49145/files#diff-186c574a5e9e4f3f1c7f3d0a4456670c788b21f22232bf8767b4bf76c419b44bL86-R95)
)