-
Notifications
You must be signed in to change notification settings - Fork 4
Gendarme.Rules.NUnit.ProvideMessageOnAssertCallsRule(git)
Sebastien Pouliot edited this page Mar 2, 2011
·
1 revision
Assembly: Gendarme.Rules.NUnit
Version: git
This rule checks that all Assert.* methods are calling with 'message' parameter, which helps to easily identify failing test.
Bad example:
[Test]
public void TestThings ()
{
Assert.AreEqual(10, 20);
Assert.AreEqual(30, 40);
}
Good example:
[Test]
public void TestThings ()
{
Assert.AreEqual(10, 20, "10 equal to 20 test");
Assert.AreEqual(30, 40, "30 equal to 40 test");
- This rule will not report any problems if only one Assert.* call was made inside a method, because it's easy to identify failing test in this case.
You can browse the latest source code of this rule on github.com
Note that this page was autogenerated (3/17/2011 1:55:44 PM) based on the xmldoc
comments inside the rules source code and cannot be edited from this wiki.
Please report any documentation errors, typos or suggestions to the
Gendarme Mailing List. Thanks!