Skip to content

refactor: improve mocking tests in FileSystemTests - #1456

Merged
vbreuss merged 3 commits into
mainfrom
topic/improve-mocking-tests
Apr 9, 2026
Merged

refactor: improve mocking tests in FileSystemTests#1456
vbreuss merged 3 commits into
mainfrom
topic/improve-mocking-tests

Conversation

@vbreuss

@vbreussvbreuss commented Apr 9, 2026

Copy link
Copy Markdown
Member

Refactors FileSystemTests to more directly validate mocked IFile behavior, and updates test dependencies to support the new assertion/verification style.

Changes:

  • Update Mock_File_Succeeds to assert ReadAllText returns a configured value and verify the call occurred.
  • Add aweXpect.Mockolate to the shared test package references.
  • Bump Mockolate package version and centrally define the aweXpect.Mockolate version.

@vbreussvbreuss self-assigned this Apr 9, 2026
CopilotAI review requested due to automatic review settings April 9, 2026 19:03

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Refactors FileSystemTests to more directly validate mocked IFile behavior, and updates test dependencies to support the new assertion/verification style.

Changes:

  • Update Mock_File_Succeeds to assert ReadAllText returns a configured value and verify the call occurred.
  • Add aweXpect.Mockolate to the shared test package references.
  • Bump Mockolate package version and centrally define the aweXpect.Mockolate version.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

FileDescription
tests/TestableIO.System.IO.Abstractions.Wrappers.Tests/FileSystemTests.csStrengthens the mock test by asserting return value and verifying invocation.
tests/Directory.Build.propsAdds aweXpect.Mockolate to the common test dependencies.
Directory.Packages.propsUpdates central package versions for Mockolate and adds aweXpect.Mockolate.

Comment threadtests/TestableIO.System.IO.Abstractions.Wrappers.Tests/FileSystemTests.cs Outdated
@vbreuss
vbreuss enabled auto-merge (squash) April 9, 2026 19:08
@sonarqubecloud

Copy link
Copy Markdown

@vbreuss
vbreuss merged commit a091ac7 into mainApr 9, 2026
11 checks passed
@vbreuss
vbreuss deleted the topic/improve-mocking-tests branch April 9, 2026 19:14
@github-actions

Copy link
Copy Markdown

This is addressed in release v22.1.1.

@github-actionsgithub-actionsBot added the state: released Issues that are released label Apr 9, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: releasedIssues that are released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@vbreuss