-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
Currently, most methods are implemented to behave as a programmer expects them to behave. However part of testing is to ensure that code handles failures as well, something which cannot be triggered by InMemoryFileSystem right now.
The class shall be enhanced to allow the "registration" of failures such as:
_fileSystem.RegisterFailure<IOException>(FileOperations.CreateFile, @"M:\foo\bar.txt");
The intention being that after this method is called, trying to create the file M:\foo\bar.txt should result in an IOException being thrown.
Examples of necessary failures:
- Failures when creating any / a specific file or directory
- Failures when opening any / a specific file
- Failures when enumerating any directory
- Failures when writing to any / a specific file
- Failures when reading from any / a specific file
It should be possible to register only those exceptions which could actually be thrown by the appropriate methods.
Reactions are currently unavailable