Zum Inhalt springen

Mock the File System

It happens quite often that our applications need to interact with the file system.  As a result, some components inevitably depend on it. When we test such code, we face a choice: mock the file system, or test against the real one?  

There are several opposing views on this. Most developers avoid using the file system in unit tests. Tests that touch the disk are usually treated as an anti‑pattern because they are slow and brittle.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert