I'm new to NMock and mocking in general. Is it possible to redefine an expectation ? In fact, I whant to mock an interface with many methods. So I decided to factorize common method expectations not to have to write them 1000 times. My issue is the following : I have a method to stub that loads a file. In most cases, the mock will do nothing for this method. So I factorized the expectation in [SetUp]
Stub.On(myMock).Method("Load").Will(Return.Value(True));
But, In a test case, I want to test that the object using the mock responds well to an exception, so I put in my test method :
Stub.On(myMock).Method("Load").Will(Throw.Exception(new FileNotFoundException()));
When I debug the test, I see the Load method is returning True. I can anderstand this, but is it possible to reset exceptation for a method or redefine it ?