From: Jeff M. <je...@mk...> - 2002-04-18 16:13:31
|
On Wed, 2002-04-17 at 22:43, Steve Freeman wrote: > > Actually the general consensus is that mocks don't need tests. The > idea > > is to keep them really simply so there's nothing in them worth > testing. > > That's the good thing about the expectation stuff. That's got tests > and > > that's the bit that doe's the work. > > Actually, I'm beginning to turn on this one. For long-term mocks, such > as in the library, it's sometimes hard to tell what they do, and it > might not be a bad idea to write the unit tests for documentation -- > rather than more javadoc. > > S. > Hmm, not sure, shouldn't the code be as self explanatory as possible. Most of the the mocks should be pretty simple. I don't think there's any need for a blanket requirement on mocks to have tests, but if people provide them that's fine. I find that if you write the mocks as you write the code and the test you don't need a test. |