When working with Rhino.Mocks with a mock object in hand:
Is there a way to pass a unit-test once an expected method is called without executing the lines after the call to this expected method?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since RhinoMocks 3.5 you can use nice
AssertWasCalled()EDIT: Answer to comment
RhinoMock is not in charge to change test execution flow, so you have to use NUnit asserts,
Assert.Pass() utility method allows you to immediately end the test, recording it as successful:
PS: as others suggested consider redesing of unit test which forced you to do such conditional test exit.