Sun, May 22 2005 10:46 PM
Rob van der Meijden
Nunit backward compatibility
For all the developers who are writing there NUnit (2.2.2) tests remember this rule:
Never use the prefix ‘Test’ when creating private methods
The previous version of NUnit requires that the test class inherit from a TestCase class and that the names of the methods running the tests begin with a "Test" prefix. These are no longer requirements because the NUnit developers have moved on to an attribute-based system. Nunit self however still interprets the test prefix, working fine for public methods, but for private methods (when you’re creating Nunit helpers for instance) you’ll get yellow colours and the following message (see also picture):
[Methodname] signature is not correct: It must be a public method
Replace or delete the Test prefix and Nunit will not try to test it again …
Filed under: .NET