Skip to content

Fix double using directive. Use Verify for snapshots.#36

Merged
Dreamescaper merged 1 commit intomasterfrom
fix-double-using
May 1, 2025
Merged

Fix double using directive. Use Verify for snapshots.#36
Dreamescaper merged 1 commit intomasterfrom
fix-double-using

Conversation

@Dreamescaper
Copy link
Owner

Fixes #35 .

@Dreamescaper Dreamescaper requested a review from Copilot May 1, 2025 11:05
Copy link

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 fixes the duplicate using directive issue and replaces legacy snapshot verification with asynchronous VerifyNUnit calls.

  • Removed unnecessary using directives and legacy snapshot regeneration code.
  • Updated test methods to use async/await and added a new test for cancellation token support.
  • Adjusted client command namespace generation by removing conditional addition of System.Threading.

Reviewed Changes

Copilot reviewed 11 out of 17 changed files in this pull request and generated no comments.

File Description
Tests/GenerateAspNetCoreClient.Tests/ClientGenerationTests.cs Removed redundant using directives and legacy snapshot logic; updated tests to async patterns and added cancellation token support.
Tests/GenerateAspNetCoreClient.Tests/ClientGenerationTests.GenerationTest_* Updated auto-generated verified files with minor comment cleanups.
GenerateAspNetCoreClient.Command/GenerateClientCommand.cs Removed conditional appending of "System.Threading" from the imported namespaces.
Files not reviewed (6)
  • GenerateAspNetCoreClient.Command/GenerateAspNetCoreClient.Command.csproj: Language not supported
  • Tests/GenerateAspNetCoreClient.Tests/GenerateAspNetCoreClient.Tests.csproj: Language not supported
  • Tests/OutputTest/OutputProject.csproj: Language not supported
  • Tests/TestWebApi.Controllers/TestWebApi.Controllers.csproj: Language not supported
  • Tests/TestWebApi.MinimalApi/TestWebApi.MinimalApi.csproj: Language not supported
  • Tests/TestWebApi.Versioning/TestWebApi.Versioning.csproj: Language not supported
Comments suppressed due to low confidence (2)

GenerateAspNetCoreClient.Command/GenerateClientCommand.cs:126

  • Verify that the removal of the conditional inclusion of 'System.Threading' does not cause issues in scenarios where cancellation token parameters are used; ensure that this namespace is imported by other means if needed.
if (options.AddCancellationTokenParameters)

Tests/GenerateAspNetCoreClient.Tests/ClientGenerationTests.cs:16

  • [nitpick] Ensure that removing the snapshot regeneration logic does not hinder future snapshot updates; consider whether a mechanism for snapshot regeneration might be needed later.
-        private static readonly bool _regenerateSnapshots = false;

@Dreamescaper Dreamescaper merged commit d6d5b62 into master May 1, 2025
1 check passed
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.

add-cancellation-token key creates using System.Threading; twice

2 participants