Testing that an event was raised

My blog has moved. You can view this post at the following address: http://www.osherove.com/blog/2009/5/23/testing-that-an-event-was-raised.html
Published Saturday, May 23, 2009 2:25 PM by RoyOsherove

Comments

Sunday, May 24, 2009 6:30 PM by DotNetShoutout

# Testing that an event was raised - Roy Osherove

Thank you for submitting this cool story - Trackback from DotNetShoutout

Monday, May 25, 2009 9:01 PM by Jeff LeBert

# re: Testing that an event was raised

I got bit once doing by an event being raised multiple times when I thought it would only be raised once. Now when I do this kind of testing I keep track of the number of times the event was raised with a counter. Sometimes I keep a list of the EventArgs that were raised. That seems like overkill so I usually just do the count.