Table of Contents

Class TheoryAttribute

Namespace
NUnit.Framework
Assembly
nunit.framework.dll

Adding this attribute to a method within a TestFixtureAttribute class makes the method callable from the NUnit test runner. There is a property called Description which is optional which you can provide a more detailed test description. This class cannot be inherited.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class TheoryAttribute : CombiningStrategyAttribute, IApplyToTest, ITestBuilder, IImplyFixture
Inheritance
TheoryAttribute
Implements
Inherited Members

Examples

[TestFixture] public class Fixture { [Test] public void MethodToTest() {}

[Test(Description = "more detailed description")] public void TestDescriptionMethod() {} }

Constructors

TheoryAttribute(bool)

Construct the attribute, specifying a combining strategy and source of parameter data.

public TheoryAttribute(bool searchInDeclaringTypes = false)

Parameters

searchInDeclaringTypes bool