Tag Archives: TDD
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 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.
The Art of Unit Testing
Have you gone through three years of computer science bachelor degree fun (or anything similar) and pretty much not heard a word about testing? Or have you heard from all your teachers that testing is extremely important, but never learned how to even write one? That has been the case for me. Testing is important, you all got to do it, it is very important, always test, do it a lot! Well, sure… but how do I do it? How do I write one of these tests?