Class TheoryAttribute
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.
Inherited Members
Namespace: NUnit.Framework
Assembly: nunit.framework.dll
Syntax
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class TheoryAttribute : CombiningStrategyAttribute, IApplyToTest, ITestBuilder, IImplyFixture
Examples
[TestFixture] public class Fixture { [Test] public void MethodToTest() {}
[Test(Description = "more detailed description")] public void TestDescriptionMethod() {} }
Constructors
View SourceTheoryAttribute(bool)
Construct the attribute, specifying a combining strategy and source of parameter data.
Declaration
public TheoryAttribute(bool searchInDeclaringTypes = false)
Parameters
Type | Name | Description |
---|---|---|
bool | searchInDeclaringTypes |