KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am using Moq as my mocking framework and I need to test a class that when a specific type of exception is run it will keep trying until the situation is resolved once that happens the execution finishes. So what I need is something similar to: myMock = Mock<IFoo>(); myMock.Setup(m => m.Excecute()).Throws<SpecificException>(); myMock.Setup(m => m.Execute()); var classUnderTest = MyClass(myMock); classUnderTest.DoSomething(); Assert.AreEqual(expected, classUnderTest.Result); Thanks for any help you can give.
Tags (comma-separated)
Save Edits
Cancel