MockObjects

January 11, 2004 – 14:16 | java

Have been playing with the MockObjects pattern and related tools lately. It’s a great technique to (almost) completely isolate a class under test from its surrounding classes.

DynaMock is probably the most interesting part of the entire MockObjects toolkit. Unfortunately it doesn’t seem to be well documented (no worse than the rest part of MockObjects though 8-) ). Here are some notes from my source code reading and hands-on experience:

  • The difference between the expect* and the match* methods on the Mock class is that an expect* method verifies the call, while a match* one simply acts as a stub and doesn’t verify.
Trackback from your site, or follow the comments in RSS.

Post a Comment