Tuesday, December 11, 2007

Rhino Mocks Quick Reference

Last week I gave a presentation on mock objects for Software Professionals of Alaska.  Once the PowerPointy hand-waving was out of the way, I illustrated the concepts with code examples using Rhino Mocks.  I thought I was well-versed in Rhino Mocks before I started, but in the process of preparing the presentation I realized there was a lot that I didn't know or had forgotten.  So I distilled all the main facts and features down into a 3-page quick reference of tables and example usage.  You might argue that 3 pages makes it a "slow reference," but regardless I still think it's useful to see all the basics stripped down to the bare minimum.  Much of the content came from the Rhino Mocks Documentation Wiki, so look there first if you need more details on a particular feature.

So without further ado, I present the Rhino Mocks 3.3 Quick Reference.  It includes:

  • the 3 different record/replay syntax styles
  • 4 types of mocks, 7 if you include MultiMocks
  • expectations and setup
  • methods
  • properties
  • events
  • exceptions
  • delegates
  • custom behavior
  • assert messages
  • ordered and unordered
  • repetition
  • the full set of argument constraints

Feedback is quite welcome.  Enjoy!

7 comments:

Anonymous said...

Nice work! You might want to post this up on the altnetpedia site...

Oran Dennison said...

Thanks! It looks like altnetpedia already has a link to Rhino Mocks under the Tools section, so I uploaded it to the Rhino Mocks documentation wiki instead.

Lee said...

Thanks for putting this together - I'm fairly new to Rhino Mocks and it's been very useful as I develop my first Rhino Mocked tests.

N. Harebottle III said...

Thanks for the hard work, this has proved MOST useful.

Oran Dennison said...

I'm glad it was useful to you! I've been meaning to update it to the new Arrange, Act, Assert syntax in Rhino Mocks 3.5 but haven't found time. Definitely take a look at Arrange, Act, Assert for yet another style of writing mocks that may feel more intuitive.

Jay said...

Yeah, I'd love to have the quick reference with AAA! Much appreciated, in any event.

Sven said...

Inspired by your document, I wrote a Quick Reference for the Arrange/Act/Assert syntax.