Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

mock return exception c#

Mock<IFileConnection> fileConnection = new Mock<IFileConnection>(
                                                           MockBehavior.Strict);
fileConnection.Setup(item => item.Get(It.IsAny<string>,It.IsAny<string>))
              .Throws(new IOException());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mock #return #exception
ADD COMMENT
Topic
Name
7+9 =