Hi Sammy, Just got to jump in on a point here . . .
> I'm not familiar with Mach-II, but I would have thought long dependency > chains are not generally advisable. And I'm certainly no expert on > that, so I could well be wrong. I can't remember a time when I've had > more than 4 or 5 in a chain though. In either case, it is important to > note that if they would be there without the mocks, they will be there > with the mocks too. And still further, if you had been doing what I > attempted to describe, all of it would be under test (that I can see - > but I may certainly have not explained it well enough, or I could be > missing something). The same cannot be said if you are only using > mocks, however. Lets imagine that ObjA calls ObjB calls ObjC calls ObjD (not best practice, but it does happen sometimes with complex models and interactions). If you mock ObjB then ObjA calls MockB which (if I get mocks right) just stubs out and responds as appropriate to calls from ObjA. If you don't do this you aren't really doing unit testing because you're doing a functional test on ObjA, ObjB, ObjC AND ObjD when you run your "unit test" on Obj A and all of them have to work right for the test to pass so your ObjA test ISN'T testing the single unit of ObjA but it's entire dependency chain. I have very little sense of unit testing in practice yet, so let me know if I'm missing anything here! :-> Best Wishes, Peter You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm CFCDev is supported by: Katapult Media, Inc. We are cool code geeks looking for fun projects to rock! www.katapultmedia.com An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org