From: Steve F. <st...@m3...> - 2003-05-08 16:09:52
|
There are various approaches to use: - pass everything in each time. We sometimes do that to start with until we figure out where to hold on to some of the objects. - pass B,C & D through to A on A's construction, if their lifecycles match appropriately. - perhaps B, C & D should be packaged up in some containing object which, in turn, can be mocked up for testing against A. Using mocks rigorously does change your coding style. I'd suggest experimenting for a while until you get used to the idea. S. Eddie Post wrote: > Hellu, > > I am just starting with mock objects and was used to use stub object. > > I have a component A that contains three links to other components, > namely B, C and D. > To test this with mock, I have to submit the three stub objects B, C and > D to A. > Is that the way to do it ? Did I understood it correctly ? > That is, am not so font about passing all those stub objects/handlers, > as it makes the interface definition somewhat complex, not not ?? > > I could think about breaking up A in smaller parts, but that not logical > in my case. > > Please some feedback how to deal with this ? |