Monday, January 10, 2011

Taunting dotNET - Rhino Mocks

RhinoMocks is a best-practice Object Mocking Framework for dotNET written by uber-dev Ayende Rahien.

Official RhinoMocks Page

Central Forum - Google Group

Good Intro Examples
- Stephen Walther

http://en.wikibooks.org/wiki/How_to_Use_Rhino_Mocks/Introduction
http://www.ayende.com/wiki/Rhino+Mocks+Introduction.ashx
http://en.wikibooks.org/wiki/How_to_Use_Rhino_Mocks/Introduction
http://house9-code-samples.blogspot.com/2008/02/rhinomocks-basics.html

Martin Fowler - Mocks/Behaviour vs Stubs/State Testing:

... I've also adjusted my vocabulary to match that of the Gerard Meszaros's xUnit patterns book... Meszaros uses the term Test Double as the generic term for any kind of pretend object used in place of a real object for testing purposes... Meszaros then defined four particular kinds of double:

- DUMMY objects are passed around but never actually used. Usually they are just used to fill parameter lists.
- FAKE objects actually have working implementations, but usually take some shortcut which makes them not suitable for production (an in memory database is a good example).
- STUBS provide canned answers to calls made during the test, usually not responding at all to anything outside what's programmed in for the test. Stubs may also record information about calls, such as an email gateway stub that remembers the messages it 'sent', or maybe only how many messages it 'sent'.
- MOCKS are what we are talking about here: objects pre-programmed with expectations which form a specification of the calls they are expected to receive.

No comments:

Post a Comment

comment: