freepascal / mockito

Automatically exported from code.google.com/p/mockito
0 stars 0 forks source link

"when" should handle an option to verify which time is being called #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I have a DataInput dataInput, which has a method readInt() and this one is 
returning an int value. I'm calling this method several times to read bytes 
from a binary stream and reconstruct them in some java primitive types. 

Since this method readInt() doesn't receive any parameter, I think that 
will be useful if the "when" has another word to specify which was the 
occurrence of the method.

Example:

when(mockDataInput.readInt(), firstTime()).thenReturn(1);

or

when(mockDataInput.readInt(), ocurrence(2)).thenReturn(12);

Thanks.

What version of the product are you using? On what operating system?

Mockito 1.7

Original issue reported on code.google.com by amoran...@gmail.com on 21 Jul 2009 at 7:41

GoogleCodeExporter commented 9 years ago
Check out a section in the docs that says about stubbing consecutive values or
something. Let me know if this is something you are after.

Original comment by szcze...@gmail.com on 22 Jul 2009 at 4:53

GoogleCodeExporter commented 9 years ago

Original comment by szcze...@gmail.com on 20 Oct 2009 at 7:45