From: Steve F. <st...@m3...> - 2003-12-16 23:55:52
|
Sounds like you should wrap the unmarshaller in an interface that you control, like you say. Joe Walnes has come up with the interesting concept that you should only mock types that you own, not third party types. It's an interesting twist that pushes you to write your code in terms of your domain, not in terms of your infrastructure. I've been doing a lot of this recently on .Net (thank you MS for your flexible libraries...) and it works nicely. S. J. Xue wrote: > ClassUnderTest calls the castor XML Unmarshaller to load ClassToMock. > For the test code to be able to sneak in a canned instance of > ClassToMock, the only way I can think of now is to make > ClassUnderTest call a factory instead of calling castor directly, but > it would unnecessarily complicate the design since most of the code > is closely tied to castor anyway. |