• C# and .NET - Programming - Testing

    Unit-testing file I/O in .NET

    File I/O looks like one of those things that cannot be unit-tested properly. A method that reads directories, scans files, compares extensions, and deletes files seems tied to the real machine where the test is running. That creates all the usual problems: tests become slow, fragile, dependent on local paths,…