Skip to content

Test BumpDotNetVersionStep through its public ExecuteAsync method - #572

Draft
dennisdoomen wants to merge 3 commits into
Fallout-build:mainfrom
dennisdoomen:bump-dotnet-version-step-execute-specs
Draft

Test BumpDotNetVersionStep through its public ExecuteAsync method#572
dennisdoomen wants to merge 3 commits into
Fallout-build:mainfrom
dennisdoomen:bump-dotnet-version-step-execute-specs

Conversation

@dennisdoomen

Copy link
Copy Markdown
Collaborator

Why

BumpDotNetVersionStepSpecs tested BumpTargetFramework/BumpSdkVersion directly, which forced those helpers to stay public even though only IMigrationStep.ExecuteAsync is the step's real contract.

What

  • Make BumpTargetFramework private.
  • Rewrite the specs to drive the step through ExecuteAsync against real files on disk (constructor + IDisposable.Dispose() pattern, AbsolutePath.Temp), asserting on file content and Summary counts.
  • Document the constructor/Dispose() fixture pattern and AAA-comment convention in docs/agents/conventions.md.

Demonstrates testing IMigrationStep implementations solely through their public method.

dennisdoomen and others added 3 commits July 26, 2026 13:40
Returns a unique path under the OS temp directory without creating the
file or directory, so tests and tools can build up a scratch location
before deciding whether it's a file or directory.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replaces the hand-rolled CreateVanillaFixture/Directory.Delete pair with
an IDisposable fixture built on AbsolutePath.Temp, and renames the test
methods to describe behaviour. Also relaxes the ReSharper
async-overload-highlighting rule for tests, where the async-suffix
convention adds noise rather than value.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Makes BumpTargetFramework private and rewrites the specs to drive the
step through IMigrationStep.ExecuteAsync against real files on disk,
demonstrating the pattern for testing migration steps via their public
API rather than internal helper methods.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@dennisdoomen dennisdoomen added target/vCurrent Targets the current version skip-changelog labels Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog target/vCurrent Targets the current version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant