NMock is a great tool for simulating (ok, mocking) objects for your unit tests. Say you want to avoid messy database or web service interractions — NMock gives you an avenue to do that. You can also simulate services which might not be consistently available.
Documentation on NMock is sketchy at best, so you need to hit Google and search around for smart folks who have gotten the arrows in their backs already. Here are a few links I’ve found helpful so far:
- NMock homepage, seems mirrored at the often unavailable www.nmock.org site.
- MockObjects. Loads of great info on mocking in general, specifics on Java APIs.
- Carter Software’s Mocking Patterns page. Nice overview.
- Jeremy Miller’s series of five posts on mock objects (He’s only got three done…)
- ThoughtWorks’ intro to NMock. Cursory, but another good example of the basics.
More as I figure it out myself!
No comments:
Post a Comment