문제

I am trying to unit test a method that calls the same method on a mocked object multiple times. In Java, using Mockito, I could provide multiple results to return from the method:

when(mock.someMethod()).thenReturn(1,1,0);

I would like to do the same for OCMockito if possible. Something like:

[given([mock someMethod]) willReturn:@1,@1,0];

Thanks for any input!

도움이 되었습니까?

해결책

OCMockito doesn't support that at this time. Feel free to submit a new issue with a feature request.

In the meantime, you may want to use a hand-rolled mock to accomplish what you need.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top