I'm using NBehave to write out my stories and using Rhino Mocks to mock out dependencies of the System(s) Under Test.
However I'm having a problem resetting expected behaviour in my mock dependencies when moving from one scenario to the next.
I only want to assert that the save method on my repository was called in two scenarios:
dependancyRepository.AssertWasCalled( ear =>
ear.Save(
Arg<IDependancy>.Is.Equal(dependency)
)
)
But this is being called in each scenario and fails in my second scenario because the Rhino Mocks expects it be called just once. I don't want to be forced to use an explicit expections but it kinda looks like I'll have too.
There are a few examples out there of NBehave with Rhino Mocks but I can't one that has multiple scenarios. And there are a few with NBehave and multiple Scenarios but no mocks.
Anybody else run into this issue?
Cheers