At the core of the library is IFileSystem and FileSystem. Instead of calling methods like File.ReadAllText directly, use IFileSystem.File.ReadAllText. We have exactly the same API, except that ours is injectable and testable. The library also ships with a series of test helpers to save you from having to mock out every call, for basic scenarios. They are not a complete copy of a real-life file system, but they'll get you most of the way there. We even support casting from the .NET Framework's untestable types to our testable wrappers. Since version 4.0 the top-level APIs expose interfaces instead of abstract base classes (these still exist, though), allowing you to completely mock the file system.
Features
- The library also ships with a series of test helpers to save you from having to mock out every call
- We even support casting from the .NET Framework's untestable types to our testable wrappers
- Since version 4.0 the top-level APIs expose interfaces instead of abstract base classes
- Completely mock the file system
- Provides examples
Categories
Software DevelopmentLicense
MIT LicenseFollow System.IO.Abstractions
You Might Also Like
MongoDB Atlas runs apps anywhere
MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of System.IO.Abstractions!