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.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class TheoryAttribute : TestCaseBuilderAttribute, ITestBuilder, IImplyFixture
- Inheritance
-
TheoryAttribute
- Implements
- Inherited Members
Examples
[TestFixture] public class Fixture { [Test] public void MethodToTest() {}
[Test(Description = "more detailed description")] publc void TestDescriptionMethod() {} }
Constructors
TheoryAttribute()
public TheoryAttribute()
Methods
BuildFrom(MethodInfo, Test)
Construct one or more TestMethods from a given MethodInfo, using available parameter data.
public IEnumerable<TestMethod> BuildFrom(MethodInfo method, Test suite)
Parameters
method
MethodInfoThe MethodInfo for which tests are to be constructed.
suite
TestThe suite to which the tests will be added.
Returns
- IEnumerable<TestMethod>
One or more TestMethods