Testing events with NUnit

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?
 
P

Peter Rilling

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top