views:

183

answers:

3

I need a tool or framework that will allow me to perform unit testing on ASP.Net applications.....Do you have one

+2  A: 

Do you mean things like nUnit (for code) and Selenium RC (for web application integration tests)

David Christiansen
I forgot to mention htat it has to be a whitebox test....Does nUnit have support for that?
cedric
I think you are talking about Integration Testing then as white box testing is dependant upon implementation.Therefore, Selenium is your answer as it allows you to write tests for each 'user path' through your web application.
David Christiansen
We need to perform a test on the backend codes(C# codes) only and on a functional level. So testing would be per function. We tried PEX but i consider pex as a blackbox test because it only provides random inputs and then process for the output. The problem is we need to check some stuffs within the function like the insertion in DB and verification of some method variables if it had the expected values.
cedric
Ok, well you can use aspects of nUnit to write tests, however I think we are stretching the term 'unit testing' if real DB inserts are being performed. I would look in to Mocking. Moq (http://code.google.com/p/moq/) is an example of an ideal mocking framework. So you would test a class and mock out all it's dependencies - ensuring that you are testing just THAT class in a repeatable environment.
David Christiansen
Ok thanks. BUt there's a sudden change. I am now required to insert testing scripts into the sourcecode itself and use the #define, #if, etc. to determine whether it is in testing mode. the problem here is asp.net don't build into class libraries or doesn't produce dll of the whole website project which i will feed into NUnit
cedric
+1  A: 

For unit, as well as integration, tests, take a look at Ivonna. Unlike Selenium, it doesn't test your client code, only server-side. It runs in-process and doesn't require a Web server. So, you can run your tests in debug mode, check variables etc.

ulu
+4  A: 

I prefer the combination of nUnit and WatiN.

Eric King
I think it is the best combination for ASP.net
egapotz