Here's another short trick for the NMock mock objects framework:
To mock an indexer use the syntax (for the getter):
Stub
.On(...).Method("get_Item").Will(Return.Value(..));
And for the setter:
Stub.On(...).Method("get_Item").Will(Return.Value(..));
*Update*
Via Paul Pierce's post I found a better way:
Stub
.On(...).Get[...].Will(Return.Value(..));
Want to join me as partner in a cool new startup?
Get in touch: pasha at cohai dot co