C# Class NUnit.Framework.Internal.Test

The Test abstract class represents a test within the framework.
Inheritance: ITest, IComparable
Show file Open project: nunit/nunit Class Usage Examples

Protected Properties

Property Type Description
DeclaringTypeInfo ITypeInfo
setUpMethods System.Reflection.MethodInfo[]
tearDownMethods System.Reflection.MethodInfo[]

Private Properties

Property Type Description
GetNextId string
Initialize void

Public Methods

Method Description
AddToXml ( TNode parentNode, bool recursive ) : TNode

Returns an XmlNode representing the current result after adding it as a child of the supplied parent node.

ApplyAttributesToTest ( Assembly provider ) : void

Modify a newly constructed test by applying any of NUnit's common attributes, based on a supplied ICustomAttributeProvider, which is usually the reflection element from which the test was constructed, but may not be in some instances. The attributes retrieved are saved for use in subsequent operations.

ApplyAttributesToTest ( ICustomAttributeProvider provider ) : void

Modify a newly constructed test by applying any of NUnit's common attributes, based on a supplied ICustomAttributeProvider, which is usually the reflection element from which the test was constructed, but may not be in some instances. The attributes retrieved are saved for use in subsequent operations.

ApplyAttributesToTest ( MemberInfo provider ) : void

Modify a newly constructed test by applying any of NUnit's common attributes, based on a supplied ICustomAttributeProvider, which is usually the reflection element from which the test was constructed, but may not be in some instances. The attributes retrieved are saved for use in subsequent operations.

CompareTo ( object obj ) : int

Compares this test to another test for sorting purposes

MakeTestResult ( ) : NUnit.Framework.Internal.TestResult

Creates a TestResult for this test.

ToXml ( bool recursive ) : TNode

Returns the Xml representation of the test

Protected Methods

Method Description
PopulateTestNode ( TNode thisNode, bool recursive ) : void

Add standard attributes and members to a test node.

Test ( IMethodInfo method ) : System

Construct a test from a MethodInfo

Test ( ITypeInfo typeInfo ) : System

TODO: Documentation needed for constructor

Test ( string name ) : System

Constructs a test given its name

Test ( string pathName, string name ) : System

Constructs a test given the path through the test hierarchy to its parent and a name.

Private Methods

Method Description
GetNextId ( ) : string
Initialize ( string name ) : void

Method Details

AddToXml() public abstract method

Returns an XmlNode representing the current result after adding it as a child of the supplied parent node.
public abstract AddToXml ( TNode parentNode, bool recursive ) : TNode
parentNode TNode The parent node.
recursive bool If true, descendant results are included
return TNode

ApplyAttributesToTest() public method

Modify a newly constructed test by applying any of NUnit's common attributes, based on a supplied ICustomAttributeProvider, which is usually the reflection element from which the test was constructed, but may not be in some instances. The attributes retrieved are saved for use in subsequent operations.
public ApplyAttributesToTest ( Assembly provider ) : void
provider System.Reflection.Assembly An object deriving from MemberInfo
return void

ApplyAttributesToTest() public method

Modify a newly constructed test by applying any of NUnit's common attributes, based on a supplied ICustomAttributeProvider, which is usually the reflection element from which the test was constructed, but may not be in some instances. The attributes retrieved are saved for use in subsequent operations.
public ApplyAttributesToTest ( ICustomAttributeProvider provider ) : void
provider ICustomAttributeProvider An object implementing ICustomAttributeProvider
return void

ApplyAttributesToTest() public method

Modify a newly constructed test by applying any of NUnit's common attributes, based on a supplied ICustomAttributeProvider, which is usually the reflection element from which the test was constructed, but may not be in some instances. The attributes retrieved are saved for use in subsequent operations.
public ApplyAttributesToTest ( MemberInfo provider ) : void
provider System.Reflection.MemberInfo An object deriving from MemberInfo
return void

CompareTo() public method

Compares this test to another test for sorting purposes
public CompareTo ( object obj ) : int
obj object The other test
return int

MakeTestResult() public abstract method

Creates a TestResult for this test.
public abstract MakeTestResult ( ) : NUnit.Framework.Internal.TestResult
return NUnit.Framework.Internal.TestResult

PopulateTestNode() protected method

Add standard attributes and members to a test node.
protected PopulateTestNode ( TNode thisNode, bool recursive ) : void
thisNode TNode
recursive bool
return void

Test() protected method

Construct a test from a MethodInfo
protected Test ( IMethodInfo method ) : System
method IMethodInfo
return System

Test() protected method

TODO: Documentation needed for constructor
protected Test ( ITypeInfo typeInfo ) : System
typeInfo ITypeInfo
return System

Test() protected method

Constructs a test given its name
protected Test ( string name ) : System
name string The name of the test
return System

Test() protected method

Constructs a test given the path through the test hierarchy to its parent and a name.
protected Test ( string pathName, string name ) : System
pathName string The parent tests full name
name string The name of the test
return System

ToXml() public method

Returns the Xml representation of the test
public ToXml ( bool recursive ) : TNode
recursive bool If true, include child tests recursively
return TNode

Property Details

DeclaringTypeInfo protected property

Used to cache the declaring type for this MethodInfo
protected ITypeInfo DeclaringTypeInfo
return ITypeInfo

setUpMethods protected property

The SetUp methods.
protected MethodInfo[],System.Reflection setUpMethods
return System.Reflection.MethodInfo[]

tearDownMethods protected property

The teardown methods
protected MethodInfo[],System.Reflection tearDownMethods
return System.Reflection.MethodInfo[]