[Mono-list] Test class for SqlBoolean
Nick Drochak
ndrochak@gol.com
Mon, 30 Sep 2002 17:47:44 +0900
| -----Original Message-----
| From: mono-list-admin@ximian.com [mailto:mono-list-admin@ximian.com]On
| Behalf Of ville
| Sent: Monday, September 30, 2002 12:23 AM
| To: mono-list
| Subject: [Mono-list] Test class for SqlBoolean
|
|
|
| Hi
|
| This is my first testsuite. Its for System.Data.SqlTypes.SqlBoolean.
| I hope this is useful. Also comments and suggestions are welcome
Thanks for this. It looks pretty complete. Just a few suggestions:
1) For AssertEquals() methods the second parameter is the expected value,
and the third parameter is the actual value. When the assert fails, you
will get a message saying something like "expected <False> but got <True>."
If you have the parameters backwards, then you'll spend a lot of time
debugging the wrong end of the problem.
2) You could use, for example, just Assert("some message", SqlTrue); instead
of the AssertEquals for testing boolean values. But that's more a matter of
style, I guess.
3) Make sure each Assert*() with a given Test*() method has a unique message
as the first parameter. This will make it much easier to figure out which
assert failed in there.
4) You've got:
SqlBoolean SqlTrue = new SqlBoolean(true);
SqlBoolean SqlFalse = new SqlBoolean(false);
in almost every test method. You might want to make those variables members
of the test class, and put that code into the Setup() method. That's what
it's for...common stuff you want done at the beginning of each test.
Thanks again,
Nick D.