Unit testing:
Visual Studio 2008 automatically generates test script for your project.
If you have any project which is free of errors and build successfully and you want to write a unit test for that,you can do that easily in Visual studio 2008.
- Add a New test project from the Solution (Right click on Solution->New Project)
- Select Test project from Templates
- or Right Click on the function which you want to write a test script->Select Create Unit tests.. It will display the Classes and below that all the functions associated to it.. Just select the functions you want to test and click Ok.
- It will create a new File in the Test project with code for that functions.
- Now Initialize an appropriate value for the expected and actual results.
- Build the project and you can Debug only this particular function in the solution by placing the cursor on the function and click on Debug Tests in Current Contest button .

No comments:
Post a Comment