Welcome to Team System Rocks Sign in | Join | Help

Mickey Gousset

My Journey Into Team System
(Add me to your Live Messenger at mickey_gousset@hotmail.com)

<July 2005>
SuMoTuWeThFrSa
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

Post Categories

News

ProTFS Book Cover

Navigation

Awards

Links-O-Interest

Syndication

Generating Unit Tests...
Covered In This Post:
  • Running Unit Tests
  • Fixing Problems Resulting From Unit Test Results
  • Checking Items Back In
  • Resolving Tasks

Previous Posts That Tie Into This One:

Remember, I am going to be following, kind of loosely, the MSDN Article "A Unit Testing Walkthrough with Visual Studio Team Test".

I right-clicked on the LogonInfo constructor and selected "Create Tests…". This opens the Generate Unit Tests window. I changed the output project to be a C# project instead of a VB project (the default):

Generate Unit Tests

I click OK and enter VSTSDemo1 as the project name. I modify the unit test as instructed in the walkthrough. I found I had to create public variables for UserId and Password to get the application to compile. Now I am ready to run the test created earlier in this post. The test failed, as expected

Test Failed

Double-click the error message to open the test results window. This shows more detail on the test and its failure:

Constuctor Test Results Window

Based on the test results, I go into the constructor class for LogonInfo and set UserID and Password to the values passed into the constructor. I run the project again, and this time the tests run successfully:

Tests Run Successfully

Notice the checkmark is green instead of a red "X". You can also double-click the test to see a results page, like we did earlier in this post. The test results window has some cool functionality we'll explore some other time, such as viewing your previously run results, sorting the information by different categories, and more columns you can add to the interface to give you more detailed information.

Up next is the "Checking For Exceptions section of the walkthrough.

First up is to write a test to prevent a null or empty string from being assigned to the user id. I open the LogonInfoTest.cs file, and enter the code. When I run this code, I expect my first test to pass, but these two to fail. Don't forget to add "using System;" to the top of the LogonInfoTest.cs file.

As you can see in the test results window, everything happened as predicted:

Tests Failed

I went into the LogonInfo.cs class, and make the changes described in the walkthrough. Now when I run my tests, they all pass:

Tests Passed

What's cool is that my original tests passed, which shows that even though I made some changes to my original code, everything is ok, and I have not broken anything.

I think its time I checked everything back in. Remember, I have to associate a task with my checkin. I think I have finished up with Task 28 at this point. I go to the Pending Checkin window, and click the Work Items button:

Pending Checkin Window

I check the box next to Task 28. I change the checkin action to "Resolve" instead of "Associate" this time, and click the Checkin button. The new test project, as well as the changes I made to LogonInfo.cs, are check in.

Now I'm going to pull the My Work Items query, to see if I can still see Task 28. In Team Explorer, I select Work Items->Project Queries->My Work Items:

My Work Items

Notice that Task 28 does not show up anymore, because it has been resolved.

In Team Explorer, I select Work Items->Project Queries->All Work Items.

All Work Items

Notice Task 28 is there, and its state is set to "Close". Also, there is more information in the "Summary" section. You can't see it all from the above screenshot, but you can see that it went from Active to Closed on 6/23/2005, by darren, and that it was resolved with ChangeSet 5.

Unfortunately at this point, due to a crash with my laptop, I lost pretty much everything. I am going to reinstall Beta 2, and then start poking around again.

Published Wednesday, July 27, 2005 11:56 PM by mickey_gousset

Comments

New Comments to this post are disabled
Powered by Community Server, by Telligent Systems