From: "veny" <ve...@p2...>
> I am writing some test using DynaMock and wondering what is a good
practice
> in returning a float value using Mock.expectAndReturn(String methodName,
> Object obj) method.
If there is no explicit overloaded expectAndReturn method for float results,
create a new Float object to wrap the primitive value. The underlying proxy
API will "unbox" the object to a primitive float when the call to the mocked
method returns.
E.g.
myMock.expectAndReturn( "methodName", new Float(1.0f) );
Cheers,
Nat.
_______________________
Dr. Nathaniel Pryce
B13media Ltd.
http://www.b13media.com
+44 (0)7712 526 661
|