Can I set a "optional" method expectation?

8 views
Skip to first unread message

Ruben Laguna

unread,
Oct 14, 2014, 5:02:20 AM10/14/14
to mox-d...@googlegroups.com
I want just ot verify that a certain method call has been invoked zero or one times.

I see that there is MultipleTimes() and InAnyOrder() but I could find anything like zero or one times, is there such a thing?

mocker = mox.Mox()
mymock = mocker.CreateMock(MyClass)
mymock.method_that_may_or_maynot_be_called().Optional()
mocker.ReplayAll()
#some code
mocker.VerifyAll()


Is there something in mox that can be used for that? Any other approach?
Reply all
Reply to author
Forward
0 new messages