Rhino Mocks 2.3

time to read 2 min | 388 words

If there is such a thing as resting your mind while working, it's what I have when I'm working on Rhino Mocks. I've just finished implementing things I talked about here, it was no small thing to do, as it changes some fundamental assumptions about way Rhino Mocks works.

Nevertheless, the actual coding was a breeze. I simply added several overloads, wrote some tests to verify that it worked and it worked. Then I wrote some edge cases tests and fixed the problems. I'd to move some basic functionality from one spot to the other (too keep with DRY principal) and I was able to do that with the certainty that I would know if I would break something. In fact, I did broke the tests a couple of time, which made me happy since the error was caught so easily. Test Driven Development rocks!

The new features are:

  • Dynamic mocks - (what I called Relaxed mocks in the previous posts) mock objects that verify any expectation that was explicitly setup and allows any unexpected methods to succeed silently. (It's accessible via mocks.DynamicMock(), I'll update the documentation later today. )
  • Added the Never() call the IRepeat interface - this has the same semantics of the Any() call (ignore ordering, etc) for use with Dynamic mocks (it's the equivalent of ExpectNoCall() in NMock)

The bug fixes include:

  • Allows to mix & match calls to Replay() & Verify() with ReplayAll() and VerifyAll()
  • A new IMockSate - VerifiedMockState that simply gives better error message if you're trying to use a verified object.

BTW, about the version numbers:

I'm going to update the minor version number every time I'll release a significant feature. I'll update the build number each time I'm doing a bug fix release. The revision number is the default .Net one right now. The recent flood in releases was caused by feedback (keep it coming) and suggestions from users which incrementally makes the framework better.