Testing events with NUnit

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a class that validates data in text files and raises events to keep
the caller informed on how things are going. I would like to test this class
using NUnit but don't know how to test events with it. Does anyone have any
ideas?
 
What do you want your event test to do?

Basically, what you could probably do is to register the necessary handler
as you would do in your application. Then create a method (that is not a
test case) that will handle the event. From within this method you should
be able to test if the your event args are correct and anything else that
you need.
 
Okay, that's simple enough. Thanks for the help.

Peter Rilling said:
What do you want your event test to do?

Basically, what you could probably do is to register the necessary handler
as you would do in your application. Then create a method (that is not a
test case) that will handle the event. From within this method you should
be able to test if the your event args are correct and anything else that
you need.
 
Back
Top