I have a database manipulating object as a dependency of my UUT (Unit Under Test). Therefore, I want to make it as a strict mock, because I also want to make sure that the UUT does not call any other methods that can result db change.
In rhino mocks I did the following:
- I made a strictmock from the db object
- I made an .Expect clause in Arrange
- I called VerifyAllExpectations in Assert
However, when I want to do this in FakeItEasy, I can't find how to do it without code duplication. I tried putting the CallsTo()+MustHaveHappened() parts in the Arrange, but then my test fail. If I put the CallsTo()+MustHaveHappened() parts in the Assert, then my test fail also, because unexpected calls were made to a strict fake. Can this be done without putting the CallsTo call into both Arrange and Assert?