Improve IFileSystem usage in the app (part 1) #4340
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 includes several changes to the
GitVersion
project, primarily focusing on the integration and usage of theIFileSystem
interface across various classes and tests, as well as some refactoring and cleanup of test files.Integration of
IFileSystem
:src/GitVersion.App/ArgumentParser.cs
: AddedIFileSystem
as a dependency and replaced direct file system calls withIFileSystem
methods. [1] [2] [3]src/GitVersion.App/GitVersionExecutor.cs
: AddedIFileSystem
as a dependency and used it for directory existence checks. [1] [2] [3]Test updates and refactoring:
src/GitVersion.App.Tests/ArgumentParserTests.cs
: IntroducedIFileSystem
and replaced direct directory creation calls withIFileSystem
methods. [1] [2] [3] [4]src/GitVersion.Core.Tests/Core/DynamicRepositoryTests.cs
: Refactored to remove redundant methods and usedIFileSystem
for directory creation. [1] [2]src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs
: Added a helper methodGetWorktreePath
to streamline test setup. [1] [2] [3] [4]Removal of
TestFileSystem
:src/GitVersion.Core.Tests/Helpers/GitVersionCoreTestModule.cs
: ReplacedTestFileSystem
with the actualFileSystem
implementation.src/GitVersion.Core.Tests/Helpers/TestFileSystem.cs
: Removed theTestFileSystem
class as it is no longer needed.Other changes:
src/GitVersion.App.Tests/GitVersion.App.Tests.csproj
: Removed references toTestFileSystem
andTestStream
.src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs
: Updated test to include a check for the configuration file path.src/GitVersion.Configuration.Tests/Configuration/Extensions.cs
: Added directory existence check and creation inSetupConfigFile
extension method.src/GitVersion.Configuration/ConfigurationProvider.cs
: UsedIFileSystem
to find the Git directory.