Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sequential stubbing #6

Closed
searls opened this issue Sep 7, 2015 · 0 comments
Closed

Add sequential stubbing #6

searls opened this issue Sep 7, 2015 · 0 comments

Comments

@searls
Copy link
Member

searls commented Sep 7, 2015

Often you want to stub different values for the first, second, third, etc., invocation of a test double. Support this with variable arguments on thenReturn

when(testDouble(8)).thenReturn(1,2,3)

testDouble(8) //1
testDouble() // undefined
testDouble(8) //2
testDouble(8) //3
testDouble(8) //3

Subsequent invocations beyond those specified will continue to return the last value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant