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
2009-07-30 09:02:06
I forgot to mention htat it has to be a whitebox test....Does nUnit have support for that?
cedric
2009-07-30 09:16:18
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
2009-07-30 09:56:47
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
2009-07-31 01:55:44
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
2009-07-31 08:50:58
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
2009-08-09 16:17:39