Reading through the existing unit testing related threads here on Stack Overflow, I couldn\'t find one with a clear answer about how to unit test file I/O operations. I have
Currently, I consume an IFileSystem object via dependency injection. For production code, a wrapper class implements the interface, wrapping specific IO functions that I need. When testing, I can create a null or stub implementation and provide that to the class under test. The tested class is none the wiser.