It would be really useful to get more documentation for SetupResult.forEventDispatcher. We've run into the assertion error below and were wondering if this is where we needed to use such a method. The code we actually call is:
Expect.call(mockNotificationManager.dispatchEvent(new ChatMessageReceivedNotification(CHAT_ID, message.body, message.from.resource, null))).returnValue(true);
and the error is:
<testcase classname="HostRoomProxyTest" name="testRoomLockedIfChatMessageReceivedAndRoomNotLocked" time="0">
<error type="asmock.framework.ExpectationViolationError">asmock.generated:IEventDispatcher6E60A431E75FAE4BDDF07A37272F437CE96FF087/dispatchEvent([Event type="receiveMessage" bubbles=false cancelable=fal
se eventPhase=2]); Expected #0, Actual #1. asmock.generated:IEventDispatcher6E60A431E75FAE4BDDF07A37272F437CE96FF087/dispatchEvent([Event type="receiveMessage" bubbles=false cancelable=false eventPhase=2]);
Expected #1, Actual #0.</error>
Many thanks
ASMock 0.9 has been updated with a new quick start guide that has an entire section on stubbing events, though SetupResult.forEventDispatcher has actually been deprecated in favour of MockRepository.stubEvents. https://sourceforge.net/apps/mediawiki/asmock/index.php?title=Stubbing_Events
This API has been superceded by MockRepository.createStub with StubOptions. What you are describing certainly looks like a bug, but it may have been fixed in a future commit. Apologies for the ridiculously late response, by the way.