Client code can eat an exception generated by NMock and pass a test that it probably shouldn't. The example code exists in a unit test, but it could just as easily be buried in client code that either was passed the Mock or obtained it through a factory.
DtServerCollection retServers = aSession.Servers; // first call... ok
retServers = aSession.Servers; // second call... should throw
//eat the exception...
mocks.VerifyAllExpectationsHaveBeenMet(); //this doesn't throw, but probably should; nunit test appears to pass
Log in to post a comment.