System.IO.Abstractions icon indicating copy to clipboard operation
System.IO.Abstractions copied to clipboard

Throws exception on call methods

Open szymonpiekny opened this issue 3 years ago • 1 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 avatar Aug 22 '22 08:08 szymonpiekny

@szymonpiekny You should already be able to this, see https://github.com/TestableIO/System.IO.Abstractions/issues/826#issuecomment-1081702068 for one possibility using Moq.

fgreinacher avatar Sep 10 '22 12:09 fgreinacher

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

fgreinacher avatar Jan 09 '23 14:01 fgreinacher