Legacy Documentation. View NUnit 3 Documentation

ExplicitAttribute (NUnit 2.2)

The Explicit attribute causes a test or test fixture to be ignored unless it is explicitly selected for running. The test or fixture will be run if it is selected in the gui, if its name is specified on the console runner command line as the fixture to run or if it is included by use of a Category filter.

If a test or fixture with the Explicit attribute is encountered in the course of running tests, the runner treats it as if it had been ignored. The progress bar turns yellow and the test is listed in the report of tests not run

Test Fixture Syntax

namespace NUnit.Tests
{
  using System;
  using NUnit.Framework;

  [TestFixture, Explicit]
  public class ExplicitTests
  {
    // ...
  }
}

Test Syntax

namespace NUnit.Tests
{
  using System;
  using NUnit.Framework;

  [TestFixture]
  public class SuccessTests
  {
    [Test, Explicit]
    public void ExplicitTest()
    { /* ... */ }
}