Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I want to do automated unit testing through code without writing test methods. I want to show the results on page that shows how many tests paassed and failed. If by using any tool or any other ways is it possible?
Posted

 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 7-Jan-13 2:45am    
Right, my 5. And I also pointed out the most widely used one, please see my answer.
—SA
__TR__ 7-Jan-13 2:45am    
+5
Please see this list: http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#.NET_programming_languages[^].

Most widely used tool is NUnit, of course, open-source:
http://en.wikipedia.org/wiki/NUnit[^],
http://www.nunit.org/[^].

—SA
 
Share this answer
 
Comments
__TR__ 7-Jan-13 2:46am    
+5
Sergey Alexandrovich Kryukov 7-Jan-13 2:48am    
Thank you,
—SA
bhagya@03 7-Jan-13 3:59am    
I want to do it from code. I have used NUnit for that. But using NUnit requires to write test methods which i dont want. I want something like this: I have list of Files displayed in Grid and if i select any file then automatic unit testing will be done and result will be shown on page giving details of unit test of that file.
Sergey Alexandrovich Kryukov 7-Jan-13 9:38am    
You should understand a simple thing: there is not such thing as miracle. If there is no test methods, then yes, you can automatically test the methods already written in your code. Of course, you can generate a number of calls, using Reflection.

But, in general case, it won't be a valid test, in principle. It will be a mess of false negatives and false positives, no matter how good is you testing application is. Do I even need to explain why?

—SA
You can take the next step also: automate the call to your Unit Tests, integrate that with automated builds. It's called Continuous Integration, and a list of tools is available at http://en.wikipedia.org/wiki/Continuous_integration[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900