Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; MenuItem has a deprecated constructor in /home/charl422/nunitsoftware.com/nunitv2/php/build_menu.php on line 34
NUnit - RequiredAddin
NUnit 2.6.6 Legacy Documentation. View NUnit 3 Documentation

RequiredAddinAttribute (NUnit 2.5)

NOTE: RequiredAddinAttribute is deprecated beginning in NUnit 2.6.5 and has been removed from NUnit 3. NUnit 3 no longer supports addins as the term is used in NUnit V2 but has other extensibility mechanisms.

The RequiredAddin attribute is used to indicate that an assembly requires a particular addin in order to function correctly. If that addin is not installed, the entire assembly is marked as non-runnable.

Note: In the Alpha-3 release, this attribute may be applied to classes or methods as well. This is of limited utility, for two reasons:

  1. If the method or class is not recognized as a test, due to the addin being missing, then NUnit will never process it.
  2. If the method or class is handled by some a different addin, that addin may not recognize the attribute.

The attribute will be limited to assemblies only in the next release.

Example

[assembly: RequiredAddin("MyTestFixtureAddin")]
[assembly: RequiredAddin("MyTestAddin")]
[assembly: RequiredAddin("MyDecoratorAddin")]

...

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

  [MyTestFixture]
  public class MyTests
  {
    [MyTest]
	public void SomeTest()
	{
	  ...
	}
  }
  
  [TestFixture, MyDecorator]
  public class MoreTests
  {
    [Test, MyDecorator]
	public void AnotherTest()
	{
	  ...
	}
  }
}