You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
If I now try to generate a stub, SimpleStubs handles this event like a normal event and creates a AsyncEvent_Raise method with return type void. But of corse this wont work if I want to await the raised event in my unit tests.
I created a extension method to raise such an async event in my code (see AsyncEventHandlerExtension in repo solution). There you can see what to do if an event delagate is having a Task as return type.
But maybe you just return an IEnumerable<T> to handle every return type and let it to the user to handle the return type.
Hi,
I want to stub a Interface containing a event with a delegate which returns a Task.
If I now try to generate a stub, SimpleStubs handles this event like a normal event and creates a
AsyncEvent_Raisemethod with return type void. But of corse this wont work if I want to await the raised event in my unit tests.I created a extension method to raise such an async event in my code (see
AsyncEventHandlerExtensionin repo solution). There you can see what to do if an event delagate is having a Task as return type.But maybe you just return an
IEnumerable<T>to handle every return type and let it to the user to handle the return type.Repo solution: SimpleStubsAndAsyncEvent.zip
Repo steps:
=> build error "can not await void" in TestClass.cs