From: Steve F. <st...@m3...> - 2002-09-13 03:57:43
|
From: "Simon Levitt" <sim...@uk...> > I've been looking into the sql Mock objects, and now in particular how to > verify the Expectations that have been set up. > > >From what I understand the only way to do this currently is to manually > code a call to verify on every MockConnection, MockStatement derived, and > MockResultSet derived, object from the test code. > > It strikes me it would be must nicer to be able to call verify on the > MockConnection and it ripple through the heirachy of objects. That's an interesting idea. Jeff has been working on "mock kits" to set up clusters of related objects, so that might be relevant. Don't forget the Verifier object that will verify all the appropriate instance variables of an object. > I've started looking into this, alongside other changes I'd like to > present in the near future, and a way of doing it would be to change > ExpectationMap and ReturnObjectList to allow the verifying their > contained objects by adding a flag to enable/disable the functionality > (with disable being the default). ReturnObjectList would have to keep > hold of returned objects in order to do this successfully. I'd like to see some concrete examples, especially for ExpectationMap which is, itself a verifiable. It's sounds like some of your tests may be going too deep. You can overspecify, as well as underspecify. Steve |