Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How do i create unit test case for my project developed in VS2012 ?

I have developed one web application in VS2012. I would like to write unit test cases using c# for that project. How can i do that? How can i create a unit testing project in visual studio?

How do i write it ? How can i execute it ? Where i can pass input parameters ?
Posted

 
Share this answer
 
Comments
Am Gayathri 2-Feb-15 7:14am    
Thanks
To create unit test case for your project,

1. Open the class contains the methods which you want to test.
2. Right click on one of the method then select 'Create unit test case'
3. Unit test case window will open with all method names which are using in that page. Select all methods then click on OK.
4.Give name for the testing project then click on OK
5.Testing project will be created and you can see your methods there.
6.Set the parameter value there then right click -> Run Tests
7.Done ! you can see the test results in result window.

Above i have explained very simply. If you want to know more please refer below link: https://msdn.microsoft.com/en-us/library/ms182532%28v=vs.90%29.aspx[^]
 
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