IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Framework.TestFixtureSourceAttribute Class Reference

TestCaseSourceAttribute indicates the source to be used to provide test fixture instances for a test class. More...

+ Inheritance diagram for NUnit.Framework.TestFixtureSourceAttribute:
+ Collaboration diagram for NUnit.Framework.TestFixtureSourceAttribute:

Public Member Functions

 TestFixtureSourceAttribute (string sourceName)
 Construct with the name of the method, property or field that will provide data More...
 
 TestFixtureSourceAttribute (Type sourceType, string sourceName)
 Construct with a Type and name More...
 
 TestFixtureSourceAttribute (Type sourceType)
 Construct with a Type More...
 
IEnumerable< TestSuiteBuildFrom (ITypeInfo typeInfo)
 Construct one or more TestFixtures from a given Type, using available parameter data. More...
 
IEnumerable< ITestFixtureDataGetParametersFor (Type sourceType)
 Returns a set of ITestFixtureData items for use as arguments to a parameterized test fixture. More...
 
- Public Member Functions inherited from NUnit.Framework.NUnitAttribute
 NUnitAttribute ()
 Default constructor More...
 

Public Attributes

const string MUST_BE_STATIC = "The sourceName specified on a TestCaseSourceAttribute must refer to a static field, property or method."
 Error message string is public so the tests can use it More...
 

Properties

string SourceName [get, private set]
 The name of a the method, property or fiend to be used as a source More...
 
Type SourceType [get, private set]
 A Type to be used as a source More...
 
string Category [get, set]
 Gets or sets the category associated with every fixture created from this attribute. May be a single category or a comma-separated list. More...
 

Private Member Functions

IEnumerable GetTestFixtureSource (Type sourceType)
 

Static Private Member Functions

static IEnumerable SourceMustBeStaticError ()
 

Private Attributes

readonly NUnitTestFixtureBuilder _builder = new NUnitTestFixtureBuilder()
 

Detailed Description

TestCaseSourceAttribute indicates the source to be used to provide test fixture instances for a test class.

Constructor & Destructor Documentation

NUnit.Framework.TestFixtureSourceAttribute.TestFixtureSourceAttribute ( string  sourceName)
inline

Construct with the name of the method, property or field that will provide data

Parameters
sourceNameThe name of a static method, property or field that will provide data.
NUnit.Framework.TestFixtureSourceAttribute.TestFixtureSourceAttribute ( Type  sourceType,
string  sourceName 
)
inline

Construct with a Type and name

Parameters
sourceTypeThe Type that will provide data
sourceNameThe name of a static method, property or field that will provide data.
NUnit.Framework.TestFixtureSourceAttribute.TestFixtureSourceAttribute ( Type  sourceType)
inline

Construct with a Type

Parameters
sourceTypeThe type that will provide data

Member Function Documentation

IEnumerable<TestSuite> NUnit.Framework.TestFixtureSourceAttribute.BuildFrom ( ITypeInfo  typeInfo)
inline

Construct one or more TestFixtures from a given Type, using available parameter data.

Parameters
typeInfoThe TypeInfo for which fixures are to be constructed.
Returns
One or more TestFixtures as TestSuite

Implements NUnit.Framework.Interfaces.IFixtureBuilder.

References NUnit.Framework.Interfaces.ITypeInfo.Type.

IEnumerable<ITestFixtureData> NUnit.Framework.TestFixtureSourceAttribute.GetParametersFor ( Type  sourceType)
inline

Returns a set of ITestFixtureData items for use as arguments to a parameterized test fixture.

Parameters
sourceTypeThe type for which data is needed.
Returns

References NUnit.Framework.Interfaces.IPropertyBag.Add(), NUnit.Framework.Internal.PropertyNames.Category, and NUnit.Framework.Internal.TestParameters.Properties.

IEnumerable NUnit.Framework.TestFixtureSourceAttribute.GetTestFixtureSource ( Type  sourceType)
inlineprivate
static IEnumerable NUnit.Framework.TestFixtureSourceAttribute.SourceMustBeStaticError ( )
inlinestaticprivate

Member Data Documentation

readonly NUnitTestFixtureBuilder NUnit.Framework.TestFixtureSourceAttribute._builder = new NUnitTestFixtureBuilder()
private
const string NUnit.Framework.TestFixtureSourceAttribute.MUST_BE_STATIC = "The sourceName specified on a TestCaseSourceAttribute must refer to a static field, property or method."

Error message string is public so the tests can use it

Referenced by NUnit.Framework.Attributes.TestFixtureSourceTests.CheckNotRunnable().

Property Documentation

string NUnit.Framework.TestFixtureSourceAttribute.SourceName
getprivate set

The name of a the method, property or fiend to be used as a source

Type NUnit.Framework.TestFixtureSourceAttribute.SourceType
getprivate set

A Type to be used as a source

string NUnit.Framework.TestFixtureSourceAttribute.Category
getset

Gets or sets the category associated with every fixture created from this attribute. May be a single category or a comma-separated list.


The documentation for this class was generated from the following file: