From: Nat P. <nat...@b1...> - 2003-08-28 10:11:39
|
Read this documentation for more info about constraints: http://www.mockobjects.com/wiki/ParameterConstraints Although I would identify methods with lots of parameters as a "code smell" that indicates that you should refactor the parameters into a new class of object. Cheers, Nat. _______________________ Dr. Nathaniel Pryce B13media Ltd. http://www.b13media.com +44 (0)7712 526 661 ----- Original Message ----- From: "Guofeng Zhang" <guo...@vi...> To: <moc...@li...> Sent: Thursday, August 28, 2003 6:26 AM Subject: [MO-java-users] How to set expection for a method with a lot of arguments My question is how to set expection for a method with a lot of arguments in a mock object. For example, there is a Timer interface: public interface Timer { int getTime( Type1 arg1, Type2 arg2, Type3 arg3, Type4 arg4, Type5 arg5 ); } In the following test code: Mock mockTimer = new Mock(Timer.class); mockTimer.expectAndReturn("getTime", ???); How to set the above expection. How to express that the getTime() can be invoked 5 times for example. Another question is: What is the difference between C.args() and C.eq(). How Constraint class and ConstraintMacher class are used. Thanks ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Mockobjects-java-users mailing list Moc...@li... https://lists.sourceforge.net/lists/listinfo/mockobjects-java-users |