[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]Re: WebHeaderCollection test

From: Gopal V
Subject: [DotGNU]Re: WebHeaderCollection test
Date: Fri, 29 Nov 2002 01:50:38 +0530
User-agent: Mutt/1.2.5i

If memory serves me right, j_post wrote:
> Here's a first cut at the unit test for WHC. 

I'm CC'ing the reply to the list .. so that the information helps others
writing test-cases as well ...

Btw, all you tests seem postive checks ... viz things that are supposed 
to work ... Try a few failing cases ... They are sometimes more important.
(see TestString.cs to see how to check for correct Exceptions)..

>  I'm not sure if these failures are due to my misunderstanding of 
>  WHC or bugs in the library.

Hehe ... you have to know something undocumented about CSUnit .... To avoid 
failed tests affecting other tests we do something like this ....

Running TestFoo.TestFunc
1) Create new object TestFoo
2) Run TestFoo.SetUp()
3) Run TestFoo.TestFunc()
4) Run TestFoo.CleanUp();
5) abandon the TestFoo object 

So a fresh copy of the object is created for all tests ... So modifications
to '' (viz assign or set) is not retained when I call the next test
function  .. Each function should be typically self contained or dependent
only on SetUp for all it's initialization needs... 

This prevents any internal messups and detects errors more accurately... 
This has also been implemented to ensure that the tests give the right 
results whatever order they are run in...

Tests are a bit different from normal apps in this ... 

Someone who doesn't want to start coding right now can update 
csunit_howto.html from all the recent discussion about test cases and
send me a patch .. Documentation is *very* important ... and I personally
suck at writing good docs ... Which is why I'm asking for help here :-)

I'm happy that I'm getting patches !!! ... (but I'd rather you submit the
*final* one to savannah...)

The difference between insanity and genius is measured by success

reply via email to

[Prev in Thread] Current Thread [Next in Thread]