views:

70

answers:

2

I think question is itself explanatory. I am wondering how it is possible to write NUnit tests for such events. If you go deeper, it looks like using ASP.NET is not appropriate for writing unit tests.

Thoughts please ..

Edit The idea of this question is, if you have a grid view in your page and let's say you have gridview.rowcommand event subscribed on this control. And, you have some logic that is implemented based on the rowcommand event arguments. Now, how will you test this method using a unit testing framework?

A: 

What are you trying to test? Do you want to test the logic inside GridView.RowCommand, or something else?

You can do this; wrap any logic inside the GridView.RowCommand inside a method, and test that method instead of the event.

If you absolutely positively must test the ASP.Net event, then you may need Ivonna, a Typemock add-on. But I have to warn you that it's not free

Ngu Soon Hui
A: 

Considering, there is no anwsers and I don't think closing this question is also appropriate. I am becoming the answerer.

Vadi