When working with Rhino.Mocks with a mock object in hand:
Is there a way to pass the unit test after calling the expected method without executing the lines after calling this expected method?
thank
With RhinoMocks 3.5 you can use nice AssertWasCalled()
AssertWasCalled()
this.Service.BuldMessage("messageId"); this.Service.AssertWasCalled(x => x.GenerateMessage("messageId"), messageId));
EDIT: reply to comment
RhinoMock is not responsible for changing the flow of the test, so you need to use NUnit statements. The Assert.Pass () utility method allows you to complete the test immediately, making it successful:
if (this.Service.AssertWasCalled(...))) { Assert.Pass("well done"); }
PS: unit test, .
AssertWasCalled() Rhino.Mocks
, , , , . (Nunit ) . , , . . . , .
, , , , . , , .