[Mono-list] Want to write tests
Nick Drochak
ndrochak@gol.com
Thu, 7 Feb 2002 14:18:35 +0900
| Any suggestions on a good starting place, or where would tests be most
| beneficial in the immediate future?
Assuming you have the sources from CVS, check out the guidelines in
mcs/class/doc/NUnitGuidelines. Getting started is pretty easy, and there's
even a template in the same directory.
Any tests for classes in the corlib would probably be of highest priority.
So look in mcs/class/corlib/Test and it's sub directories for missing tests.
The 'System' subdir doesn't nearly have as many tests as it should, for
instance.
Just to get started you might want to write a test for one (or many :) of
the Exception classes that Duncan put in /mcs/class/corlib/System.
Basically you would just be testing the constructors and make sure the
Exception you catch has the values set correctly. Something like this as an
example for one of the test methods:
TestConstructorJustMessage()
{
const string message = "test";
try
{
throw new ArgumentException(message);
}
catch (ArgumentException e)
{
AssertEquals("Message value incorrect", message, e.Message);
//...asserts for default values for other properties, etc.
}
}
If this isn't enough info, post your questions back to the list, or catch me
on IRC (#mono on irc.gnome.org:6667) and maybe I can help.
HTH,
Nick D.