NUnit 2.2.10 Legacy Documentation. View NUnit 3 Documentation

SuiteAttribute (NUnit 2.0)

The Suite Attribute is used to define subsets of suites based on user preference. The belief by the developers of this version is that the need for this will diminish because of the dynamic creation mechanism provided by the framework. However it is provided for backwards compatibility.

Note: There is no way to run user-defined suites in the forms interface.

Example:

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

  public class AllTests
  {
    [Suite]
    public static TestSuite Suite
    {
      get
      {
        TestSuite suite = new TestSuite("All Tests");
        suite.Add(new OneTestCase());
        suite.Add(new Assemblies.AssemblyTests());
        suite.Add(new AssertionTest());
        return suite;
      }
    }
  }
}