I've been using Moq, and I want to create a mock object that forbids any calls other than those I have specified. I can't find a way to do this in TypeMock other than to verify that every method was not called.
In Moq, I do this with:
mock = new Mock<IMyInterface>(MockBehavior.Strict);
mock.VerifyAll();
In TypeMock, the closest I can find is this:
// MustSpecifyReturnValues does what I want, except for void methods
Isolate.Fake.Instance<IMyInterface>(Members.MustSpecifyReturnValues);
// Do this for all void methods
Isolate.Verify.WasNotCalled(...);
Isolate.Verify.WasNotCalled(...);
Isolate.Verify.WasNotCalled(...);
Isolate.Verify.WasNotCalled(...);
Is there a way to do this without explicitly checking each method? Or a way to make the default implementation for all the mocked methods throw?