Conversation
Support initializing a directory in the `MockFileSystem` from a real directory.
There was a problem hiding this comment.
Pull request overview
Adds support for initializing a MockFileSystem directory structure from an existing directory on the real file system, enabling easier seeding of mock data in tests.
Changes:
- Introduced
InitializeFromRealDirectoryonFileSystemInitializerExtensionsto copy a real directory into anIFileSystem. - Added unit tests covering file copy, recursive directory copy, and the missing-source-directory error case.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| Source/Testably.Abstractions.Testing/FileSystemInitializerExtensions.cs | Adds the new initialization API and recursive copy implementation. |
| Tests/Testably.Abstractions.Testing.Tests/FileSystemInitializerExtensionsTests.cs | Adds test coverage for the new initializer behavior. |
Source/Testably.Abstractions.Testing/FileSystemInitializerExtensions.cs
Outdated
Show resolved
Hide resolved
Source/Testably.Abstractions.Testing/FileSystemInitializerExtensions.cs
Outdated
Show resolved
Hide resolved
Source/Testably.Abstractions.Testing/FileSystemInitializerExtensions.cs
Outdated
Show resolved
Hide resolved
Source/Testably.Abstractions.Testing/FileSystemInitializerExtensions.cs
Outdated
Show resolved
Hide resolved
Source/Testably.Abstractions.Testing/FileSystemInitializerExtensions.cs
Outdated
Show resolved
Hide resolved
|
Test Results 52 files ± 0 52 suites ±0 37m 32s ⏱️ + 1m 5s For more details on these failures, see this check. Results for commit 2eb09c0. ± Comparison against base commit 1253c6b. |
|
This is addressed in release v5.3.0. |



Adds support for initializing a
MockFileSystemdirectory structure from an existing directory on the real file system, enabling easier seeding of mock data in tests.Key Changes:
InitializeFromRealDirectoryonFileSystemInitializerExtensionsto copy a real directory into anIFileSystem.