John Sands' Radio Weblog :
Updated: 9/19/2002; 12:08:19 PM.

 

 
 

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Monday, April 08, 2002

Using Unit Tests. Thoughts on unit testing and refactoring. [The .NET Guy] I hadn't heard of NUnit before. It looks interesting, but I can't use it yet. I use .NET to write tests for COM components, not for .NET assemblies.

I have an HTTPTester project that is going well. A test suite is an XML file. Each test is a URL. HTTPTester provides the facilities to save the result in a file and compare it with the expected file. Because the results are usually long XML or HTML strings, I don't define the expected results before running the test, the way I usually do. Instead, HTTPTester has a Copy to Expected button which I use after a careful manual inspection of the actual output. The Compare button took a few minutes to implement - it just calls Windiff for the two files - and it's all I need to see where the differences are. There's also a side-by-side view that is simply two frames that both implement an IE browser. Small cost; huge benefit.

One thing I always add to a test project that I didn't see in NUnit is a way to automate it. HTTPTester can take a test file on the command line and there are command line switches to shut itself down if there are no errors and send an email if there are errors. It also posts the last run results in a file. So I'll be able to schedule it on my machine at the office and check it from home and be alerted if it failed.
8:14:57 AM    


© Copyright 2002 John Sands.



Click here to visit the Radio UserLand website.

 


April 2002
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
Mar   May

PicoSearch
blogchalk: John/Male/46-50. Lives in United States/Palm Bay/Lockmar and speaks English. Spends 80% of daytime online. Uses a Faster (1M+) connection.