Tag Archives: Async

C#: How to test asynchronous events

The other day I had to test that an event was raised after some asynchronous work had been done. And since I currently am a total test newbie, this was a new thing for me. Say we have this simple shell of a class:

public class Worker
{
    public event EventHandler<eventargs> Done;

    public void Start()
    {
       ...
    }
}</eventargs>

Let’s just assume it does some work, and is supposed to raise the Done event when it is… well… done.

Continue reading C#: How to test asynchronous events