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.TestCaseSourceAttribute Class Reference

TestCaseSourceAttribute indicates the source to be used to provide test cases for a test method. More...

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

Public Member Functions

 TestCaseSourceAttribute (string sourceName)
 Construct with the name of the method, property or field that will provide data More...
 
 TestCaseSourceAttribute (Type sourceType, string sourceName)
 Construct with a Type and name More...
 
 TestCaseSourceAttribute (Type sourceType)
 Construct with a Type More...
 
IEnumerable< TestMethodBuildFrom (IMethodInfo method, Test suite)
 Construct one or more TestMethods from a given MethodInfo, using available parameter data. More...
 
- Public Member Functions inherited from NUnit.Framework.NUnitAttribute
 NUnitAttribute ()
 Default constructor 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< ITestCaseDataGetTestCasesFor (IMethodInfo method)
 Returns a set of ITestCaseDataItems for use as arguments to a parameterized test method. More...
 
IEnumerable GetTestCaseSource (IMethodInfo method)
 

Static Private Member Functions

static IEnumerable SourceMustBeStaticError ()
 

Private Attributes

NUnitTestCaseBuilder _builder = new NUnitTestCaseBuilder()
 

Detailed Description

TestCaseSourceAttribute indicates the source to be used to provide test cases for a test method.

Constructor & Destructor Documentation

NUnit.Framework.TestCaseSourceAttribute.TestCaseSourceAttribute ( 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.TestCaseSourceAttribute.TestCaseSourceAttribute ( 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.TestCaseSourceAttribute.TestCaseSourceAttribute ( Type  sourceType)
inline

Construct with a Type

Parameters
sourceTypeThe type that will provide data

Member Function Documentation

IEnumerable<TestMethod> NUnit.Framework.TestCaseSourceAttribute.BuildFrom ( IMethodInfo  method,
Test  suite 
)
inline

Construct one or more TestMethods from a given MethodInfo, using available parameter data.

Parameters
methodThe IMethod for which tests are to be constructed.
suiteThe suite to which the tests will be added.
Returns
One or more TestMethods

Implements NUnit.Framework.Interfaces.ITestBuilder.

References NUnit.Framework.Internal.Builders.NUnitTestCaseBuilder.BuildTestMethod().

Referenced by NUnit.Framework.Attributes.TestMethodBuilderTests.TestCaseSourceAttribute_NoArgs_NotRunnable(), NUnit.Framework.Attributes.TestMethodBuilderTests.TestCaseSourceAttribute_RightArgs_Runnable(), and NUnit.Framework.Attributes.TestMethodBuilderTests.TestCaseSourceAttribute_WrongArgs_NotRunnable().

IEnumerable<ITestCaseData> NUnit.Framework.TestCaseSourceAttribute.GetTestCasesFor ( IMethodInfo  method)
inlineprivate

Returns a set of ITestCaseDataItems for use as arguments to a parameterized test method.

Parameters
methodThe method for which data is needed.
Returns

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

IEnumerable NUnit.Framework.TestCaseSourceAttribute.GetTestCaseSource ( IMethodInfo  method)
inlineprivate
static IEnumerable NUnit.Framework.TestCaseSourceAttribute.SourceMustBeStaticError ( )
inlinestaticprivate

Member Data Documentation

NUnitTestCaseBuilder NUnit.Framework.TestCaseSourceAttribute._builder = new NUnitTestCaseBuilder()
private

Property Documentation

string NUnit.Framework.TestCaseSourceAttribute.SourceName
getprivate set

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

Type NUnit.Framework.TestCaseSourceAttribute.SourceType
getprivate set

A Type to be used as a source

string NUnit.Framework.TestCaseSourceAttribute.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: