8000 Update tests for test templates by mariam-abdulla · Pull Request #49145 · dotnet/sdk · GitHub
[go: up one dir, main page]

Skip to content

Update tests for test templates #49145

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

Merged
merged 3 commits into from
May 26, 2025

Conversation

mariam-abdulla
Copy link
Member
@mariam-abdulla mariam-abdulla commented May 26, 2025

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:

  • Replaced hardcoded target framework ("net10.0") with ToolsetInfo.CurrentTargetFramework in the SupportedTargetFrameworks array for dynamic framework compatibility. ([test/dotnet-new.IntegrationTests/DotnetNewTestTemplatesTests.csL14-R14](https://github.com/dotnet/sdk/pull/49145/files#diff-186c574a5e9e4f3f1c7f3d0a4456670c788b21f22232bf8767b4bf76c419b44bL14-R14))
  • Updated the template package path to use 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:

  • Replaced .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:

  • Adjusted comments in the ItemTemplate_CanBeInstalledAndTestArePassing method to clarify the purpose and parameters of the dotnet new command. ([test/dotnet-new.IntegrationTests/DotnetNewTestTemplatesTests.csL86-R95](https://github.com/dotnet/sdk/pull/49145/files#diff-186c574a5e9e4f3f1c7f3d0a4456670c788b21f22232bf8767b4bf76c419b44bL86-R95))

@Copilot Copilot AI review requested due to automatic review settings May 26, 2025 09:23
@mariam-abdulla mariam-abdulla requested a review from a team as a code owner May 26, 2025 09:23
@mariam-abdulla mariam-abdulla enabled auto-merge (squash) May 26, 2025 09:24
Copy link
Contributor
@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 PR updates the integration tests for dotnet-new test templates to use dynamic framework values and a more concise assertion API.

  • Replaced hard-coded net10.0 with ToolsetInfo.CurrentTargetFramework and updated template package path to use ToolsetInfo.CurrentTargetFrameworkVersion.
  • Switched from .Should().ExitWith(0) to .Should().Pass().
  • Adjusted a comment placeholder to reflect the outputDirectory variable.

Copy link
Member
@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

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

Some style nitpick

@mariam-abdulla mariam-abdulla merged commit 0eb6d4a into main May 26, 2025
30 checks passed
@mariam-abdulla mariam-abdulla deleted the dev/mabdullah/update-tests-for-test-templates branch May 26, 2025 11:11
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.

2 participants
0