Skip to content

Commit c427729

Browse files
Copilotvbreuss
andcommitted
Add comprehensive section about relationship with Testably.Abstractions
Co-authored-by: vbreuss <[email protected]>
1 parent c34f933 commit c427729

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,42 @@ public class SomeClassUsingFileSystemWatcher
160160

161161
- [`Testably.Abstractions`](https://github.com/Testably/Testably.Abstractions)
162162
provides alternative test helpers and additional abstractions.
163+
164+
## Relationship with Testably.Abstractions
165+
166+
[`Testably.Abstractions`](https://github.com/Testably/Testably.Abstractions) is a complementary project that uses the same interfaces from [`TestableIO.System.IO.Abstractions`](https://www.nuget.org/packages/TestableIO.System.IO.Abstractions). This means **no changes to your production code are necessary** when switching between the testing libraries.
167+
168+
### Key Differences and Features
169+
170+
**Testably.Abstractions** offers more extensive testing helpers and features compared to this project:
171+
172+
- **Advanced time handling** with `ITimeSystem` interface
173+
- **Random system abstractions** with `IRandomSystem` interface
174+
- **Drive management** with support for multiple drives and limited size simulation
175+
- **FileSystemWatcher** support for testing file system events
176+
- **SafeFileHandle** support for advanced file operations
177+
- **More comprehensive API** for complex testing scenarios
178+
179+
### Migration Guide
180+
181+
To switch from `TestableIO.System.IO.Abstractions.TestingHelpers` to `Testably.Abstractions.Testing`:
182+
183+
1. **In your test projects**: Replace the reference to [`TestableIO.System.IO.Abstractions.TestingHelpers`](https://www.nuget.org/packages/TestableIO.System.IO.Abstractions.TestingHelpers) with [`Testably.Abstractions.Testing`](https://www.nuget.org/packages/Testably.Abstractions.Testing)
184+
2. **In your production code**: No changes needed! Both libraries use the same [`TestableIO.System.IO.Abstractions`](https://www.nuget.org/packages/TestableIO.System.IO.Abstractions) interfaces
185+
3. **In your tests**: Use the `MockFileSystem` from `Testably.Abstractions.Testing` instead
186+
187+
### Architectural Differences
188+
189+
The main architectural difference lies in how the mock file systems handle state:
190+
191+
- **TestableIO.System.IO.Abstractions** allows direct access to stored entities (`MockFileData` and `MockDirectoryData`), which can make maintaining consistent state challenging, especially for features like correct `LastAccessTime` and `LastWriteTime` updates.
192+
193+
- **Testably.Abstractions** uses a more restrictive approach that only allows manipulation through normal file system operations, enabling advanced scenarios like consistent time updates, FileSystemWatcher support, and multi-drive simulation.
194+
195+
### Testing and Compatibility
196+
197+
`Testably.Abstractions` features a more extensive test suite that runs against real file systems on Linux, Windows, and macOS. This ensures that tested scenarios work identically on both the mock and real file systems.
198+
199+
### Maintenance and Development
200+
201+
Both projects share the same maintainer, but active development and new features are primarily focused on the Testably.Abstractions project. TestableIO.System.IO.Abstractions continues to be maintained for stability and compatibility, but significant new functionality is unlikely to be added.

0 commit comments

Comments
 (0)