TestAttribute Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adding this attribute to a method within a 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.
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class TestAttribute : NUnit.Framework.NUnitAttribute, NUnit.Framework.Internal.IApplyToTest
type TestAttribute = class
inherit NUnitAttribute
interface IApplyToTest
- Inheritance
- Attributes
- Implements
Examples
[TestFixture] public class Fixture { [Test] public void MethodToTest() {} [Test(Description = "more detailed description")] publc void TestDescriptionMethod() {} }
Constructors
TestAttribute() |
Properties
Description |
Descriptive text for this test |
Methods
ApplyToTest(Test) |