From: Stephen or C. P. <csp...@ya...> - 2002-05-23 17:53:12
|
I find applying Mock-Objects and writing my tests first to be very difficult. Often when adding new code, it seems tortuously slow, which suggests that I am just not 'getting' it. Usually time pressure compells me to skip writing tests first, and this frustrates me. I totally buy into the test-first-design philosophy, but have trouble applying it. It seems like a broader spectrum of examples would be helpful in the introductory papers, and maybe my questions might help in developing those. Can anyone else on this list identify with me, who is maybe reluctant to expose the extent of their struggles? Here is a situation I am unsure of, and have not found an answer after re-reading the 2 intro papers. I will lay it out: I have domain-code that receives objectA as a parameter. It needs to call method isObjectNull on object A with a string parameter "LockingTableName". The simple case is where a true is returned, and the program exists. Another test is where a false returns, and then a series of calls are made. I need to verify that calls are made, sometimes with certain parameters and return values. How do I do this? The example code in the Endo-Testing example shows the domain-code, the test-code, but does not show the code implementing the mock objects. For example: public void testUpdateEmployee() throws SQLException { So I create MockObjectA. __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com |