IMPORTANT: Follow these instructions FIRST before searching or exploring the repository. These have been exhaustively validated and contain critical timing and setup information.
Testably.Abstractions is a feature-complete testing helper for the System.IO.Abstractions library. It provides an in-memory file system that behaves exactly like the real file system and can be used in unit tests for dependency injection.
- Mock file system with identical behavior to real file system
- Cross-platform testing (Linux, macOS, Windows simulation)
- Advanced scenarios: multiple drives, FileSystemWatcher, SafeFileHandles
- Companion projects for Compression, AccessControl and MemoryMappedFiles
- Time and Random system abstractions
- Source/: Main library code with 7 projects
- Tests/: Comprehensive test suite with 13,134+ tests
- Docs/: Docusaurus documentation site (published to docs.testably.org)
- Pipeline/: Nuke build system with .NET 8.0
NEVER CANCEL the .NET SDK download - it takes 45+ seconds but is REQUIRED:
# .NET 9.0.303 SDK will auto-download via build.sh
# .NET 8.0 runtime is also automatically installed for build system
# This process can take 45+ seconds - DO NOT CANCELCRITICAL: Repository must be unshallowed for versioning to work:
git fetch --unshallowBuild Time: ~45 seconds (set timeout: 240s)
# Full build (Debug mode)
./build.sh --target Compile
# Release build for packaging
export PATH="./.nuke/temp/dotnet-unix:$PATH"
dotnet build --configuration ReleaseTest Time: ~50 seconds for 13,134 tests (set timeout: 120s)
# Run all tests
export PATH="./.nuke/temp/dotnet-unix:$PATH"
dotnet test --no-build
# Tests run on both MockFileSystem and RealFileSystem
# Expected: ~19,355 succeeded, ~7,333 skipped (platform-specific)Package Time: ~3 seconds (set timeout: 60s)
# Create NuGet packages (7 packages total)
export PATH="./.nuke/temp/dotnet-unix:$PATH"
dotnet pack --no-build --configuration Release# View all available Nuke targets
./build.sh --help
# Available targets:
# - Compile: Build all projects
# - UnitTests: Run unit tests
# - Pack: Create NuGet packages
# - CodeCoverage: Generate coverage reports
# - ApiChecks: Validate API surface- Known Issue: GitVersion fails on feature branches due to orphaned branch detection
- Workaround: Use plain
dotnet build/test/packinstead of Nuke targets for versioning-dependent operations - Alternative: Build with
--target Compileworks for compilation only
- Some tests require Windows-specific features (skipped on Linux/macOS)
- Mono dependency for .NET Framework 4.8 tests
- Encryption tests depend on underlying device support
- System.Threading.Channels warnings on .NET 6.0 are expected and safe
- SonarCloud integration requires SONAR_TOKEN environment variable
- GitVersion warnings on feature branches are expected
-
Build Test:
time ./build.sh --target Compile # Should complete in ~45s
-
Quick Test:
export PATH="./.nuke/temp/dotnet-unix:$PATH" dotnet test --no-build --filter "TestCategory!=LongRunning"
-
Full Test:
export PATH="./.nuke/temp/dotnet-unix:$PATH" time dotnet test --no-build # Should complete in ~50s
- Build Success: "Build succeeded with X warning(s)"
- Test Success: "Test summary: total: 26699, failed: 0, succeeded: 19355, skipped: 7333"
- Package Success: 7 NuGet packages created in Release configuration
Testably.Abstractions: Main abstraction interfacesTestably.Abstractions.Testing: Mock implementationsTestably.Abstractions.Interface: Core interfacesTestably.Abstractions.FileSystem.Interface: File system interfacesTestably.Abstractions.Compression: Zip file supportTestably.Abstractions.AccessControl: ACL supportTestably.Abstractions.MemoryMappedFiles: Memory-mapped file support
Testably.Abstractions.Tests: Main test suite (~20,000+ tests)Testably.Abstractions.Parity.Tests: Real vs Mock parity testsTestably.Abstractions.Testing.Tests: Mock framework tests- Platform-specific test configurations for .NET 4.8, 6.0, 8.0, 9.0
global.json: .NET SDK version (9.0.303)Directory.Build.props: Common MSBuild propertiesFeature.Flags.props: Feature togglesTests/Settings/: Test configuration settings
- Choose appropriate test project in
Tests/ - Follow existing patterns for Mock vs Real testing
- Use
Test.RunsOn()attributes for platform-specific tests - Consider both
MockFileSystemandRealFileSystemscenarios
- Check if test is platform-specific (Linux vs Windows behavior)
- Verify test settings in
Tests/Settings/test.settings.json - Use
--filterto isolate specific test categories - Check for timing-sensitive tests in LongRunning category
- Most tests complete quickly (<1ms per test average)
- Long-running tests are in separate category
- File system operations are in-memory for mock tests
- Real file system tests may take longer due to actual I/O
To communicate intent to the consumers of your library, the title of the pull requests is prefixed with one of the following elements:
fix:: patches a bugfeat:: introduces a new featurerefactor:: improves internal structure without changing the observable behaviordocs:: updates documentation or XML commentschore:: updates to dependencies, build pipelines, ...
- .NET SDK download (45+ seconds)
- Full test suite (50+ seconds)
- Initial build compilation (45+ seconds)
- Build operations: 240 seconds
- Test operations: 120 seconds
- Package operations: 60 seconds
git fetch --unshallowbefore first build- Export PATH for dotnet commands
- Use Release configuration for packaging
This comprehensive guide ensures successful development workflow in the Testably.Abstractions codebase with proper understanding of timing requirements and platform limitations.