Groups
Sign in
Groups
mox-discuss
Conversations
About
Send feedback
Help
Can I set a "optional" method expectation?
8 views
Skip to first unread message
Ruben Laguna
unread,
Oct 14, 2014, 5:02:20 AM
10/14/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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