Skip to content

Gendarme.Rules.NUnit.TestMethodsMustBePublicRule(2.10)

Sebastien Pouliot edited this page Jan 22, 2011 · 2 revisions

TestMethodsMustBePublicRule

Assembly: Gendarme.Rules.NUnit
Version: 2.10

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);
}
Clone this wiki locally