Take the 2-minute tour ×

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

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

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

share|improve this answer
I forgot to mention htat it has to be a whitebox test....Does nUnit have support for that? –  cedric Jul 30 '09 at 9:16
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 Jul 30 '09 at 9:56
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 Jul 31 '09 at 1:55
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 (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 Jul 31 '09 at 8:50
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 Aug 9 '09 at 16:17
add comment

I prefer the combination of nUnit and WatiN.

share|improve this answer
I think it is the best combination for ASP.net –  castle1971 Aug 4 '09 at 13:55
add comment

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.

share|improve this answer
add comment

Your Answer


