I tried EasyMockNET and it's very cool stuff, but how can I deal with events in EasyMockNET ?
I want to mock interface:
Now when a real object uses this mock my test fails with exception
"Unexpected method call add_DoCallback(System.EventHandler`1 DataEventArgs`1):
add_DoCallback(System.EventHandler`1 DataEventArgs`1): expected: 0, actual: 1".
How can I aviod this ? How should I add expectations on events ?
Yes, add an expectation on an event by subscribing to it just as you'd call a method. Just think of += and -= as method calls - that's what they are, really.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.