Skip to content

InMemoryFileSystem should provide options for failures #11

Description

@Kittyfisto

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions