From: Joe W. <jo...@tr...> - 2003-07-18 08:27:55
|
Not sure if this has been mentioned yet... It would be much more flexible if the first argument of all the match and expect methods (i.e. the name) took a Constraint instead of a String. -joe Nat Pryce wrote: >The MockObjects website has example code that does almost exactly what you >want. > >Look at http://www.mockobjects.com/wiki/CallableDecorators > >Cheers, > Nat. >_______________________ >Dr. Nathaniel Pryce >B13media Ltd. >http://www.b13media.com >+44 (0)7712 526 661 > >----- Original Message ----- >From: <mai...@ji...> >To: <moc...@li...> >Sent: Thursday, July 17, 2003 7:26 PM >Subject: [MO-java-users] RegEx-like method names for matchAndReturn? > > > > >>Is there any way to have Mock.matchAndReturn() match against method >>names using wildcards? For example, I'd like to: >> >>Mock mock = new Mock( InterfaceWithLotsOfBooleans.class ); >>mock.matchAndReturn( "is*", false ); >> >>Which for any isProperty method call would return false. >> >>I figure that some kind of callable subclass is necessary, but with very >>little in the way of javadocs (and the unit tests aren't helpful here), >>I don't know where to go. >> >>;ted >> >> >> >>------------------------------------------------------- >>This SF.net email is sponsored by: VM Ware >>With VMware you can run multiple operating systems on a single machine. >>WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the >>same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 >>_______________________________________________ >>Mockobjects-java-users mailing list >>Moc...@li... >>https://lists.sourceforge.net/lists/listinfo/mockobjects-java-users >> >> > > > >------------------------------------------------------- >This SF.net email is sponsored by: VM Ware >With VMware you can run multiple operating systems on a single machine. >WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the >same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 >_______________________________________________ >Mockobjects-java-users mailing list >Moc...@li... >https://lists.sourceforge.net/lists/listinfo/mockobjects-java-users > > |