dhamini-poornachandra / mockito

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

documentation bug for ReturnsElementsOf and AdditionalAswers.returnsElementsOf() #391

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
in both places noted in summary above, documentation shows example code with 
improper and uncompilable use of ".thenReturn" instead of ".thenAnswer":

when(mock.foo()).thenReturn(1, 2, 3);
//is equivalent to:
when(mock.foo()).thenReturn(new ReturnsElementsOf(Arrays.asList(1, 2, 3)));

Also, for the AdditionalAnswers.returnsElementsOf(), you should actually use 
the static method rather than "new ReturnsElementsOf".

Original issue reported on code.google.com by kandpwel...@gmail.com on 31 Oct 2012 at 3:54

GoogleCodeExporter commented 8 years ago
hi thx for the feedback (fixed)

Original comment by brice.du...@gmail.com on 2 Nov 2012 at 7:53

GoogleCodeExporter commented 8 years ago

Original comment by brice.du...@gmail.com on 2 Nov 2012 at 7:53

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 16 Aug 2014 at 2:43

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 24 Aug 2014 at 3:14

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 24 Aug 2014 at 3:50