Skip to content

Gendarme.Rules.NUnit.TestMethodsMustBePublicRule(git)

Sebastien Pouliot edited this page Mar 2, 2011 · 1 revision

TestMethodsMustBePublicRule

Assembly: Gendarme.Rules.NUnit
Version: git

Description

Test method (a method, marked with either TestAttribute, TestCaseAttribute or TestCaseSourceAttribute) is not public. Most NUnit test runners won't execute non-public unit tests.

Examples

Bad example:

[Test]
private void TestMethod ()
{
    Assert.AreEqual (10, 20);
}

Good example:

public void TestMethod ()
{
    Assert.AreEqual (10, 20);
}

Source code

You can browse the latest source code of this rule on github.com

Clone this wiki locally