TDD in C# with the VSTS Unit Test Tool
This download contains the result of following the exercises in Chapters 14 to 17. In these exercises you will acheive the following:
* Setup a Visual Studio Project for Unit Testing
* Create a list of tests to drive the developement of the code for your 'Image Favorities' Story
* Work through the list of tests, implementing the code to make them pass and refactoring as you go
* Gain of experience of doing small and large refactorings
* Produce Code Coverage and Performance information
* Learn how to integrate test-first programming with the development of a user interface
Instructions:
1. Download the file and extract into a directory on your hard disk
2. Open the Visual Studio Solution (File - Open - Project Solution) - ignore any messages about Source Control
3. Build the Solution (Build - Rebuild Solution)
4. Run the Tests
a. Open the Test View window (Test - Windows - Test View)
b. Select all the tests in the Test View window list; except ManualTest1
c. Run the selected tests (click the button at the top left of the Test View window)
d. Observe the results in your Test Results window
5. Check the Code Coverage (click the button at the top right of the Test Results window to open Code Coverage Results window)
6. Run the program (Debug - Start without Debugging) to start the application
7. Add an item to the Favorites menu:
a. Open the 'Add Favorite' dialog box (Favorites - Add)
b. Enter a label (e.g. test) as well as the corresponding database reference (e.g. db://0001)
c. Click OK.
8. Close the application
When you run the tests (4c) they should all pass. When you open the Code Coverage Results window (5) you should discover that 95% of the code is covered by the test. When you run the program (6) a Windows Forms Application should open on your desktop allowing you to create a list of references to database images in the 'Favorites' menu (7).
↧