TestableIO / System.IO.Abstractions

Just like System.Web.Abstractions, but for System.IO. Yay for testable IO access!

Home Page:http://www.nuget.org/packages/System.IO.Abstractions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Throws exception on call methods

szymonpiekny opened this issue · comments

Is your feature request related to a problem? Please describe.
It should be possible to throw exception while call methods on FileSystemMock.

Describe the solution you'd like
_fileSystemMock.Setup(q => q.File.WriteAllText(It.IsAny<string>(), It.IsAny())).Throws<OutOfMemoryException>();

@szymonpiekny You should already be able to this, see #826 (comment) for one possibility using Moq.

I'm closing this. Feel free to reopen if something is unclear!