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.Internal.Builders.NUnitTestCaseBuilder Class Reference

NUnitTestCaseBuilder is a utility class used by attributes that build test cases. More...

+ Collaboration diagram for NUnit.Framework.Internal.Builders.NUnitTestCaseBuilder:

Public Member Functions

 NUnitTestCaseBuilder ()
 Constructs an NUnitTestCaseBuilder More...
 
TestMethod BuildTestMethod (IMethodInfo method, Test parentSuite, TestCaseParameters parms)
 Builds a single NUnitTestMethod, either as a child of the fixture or as one of a set of test cases under a ParameterizedTestMethodSuite. More...
 

Static Private Member Functions

static bool CheckTestMethodSignature (TestMethod testMethod, TestCaseParameters parms)
 Helper method that checks the signature of a TestMethod and any supplied parameters to determine if the test is valid. More...
 
static bool MarkAsNotRunnable (TestMethod testMethod, string reason)
 

Private Attributes

const string DEFAULT_TEST_NAME_PATTERN = "{m}{a:40}"
 
readonly Randomizer _randomizer = Randomizer.CreateRandomizer()
 
readonly TestNameGenerator _nameGenerator
 

Detailed Description

NUnitTestCaseBuilder is a utility class used by attributes that build test cases.

Constructor & Destructor Documentation

NUnit.Framework.Internal.Builders.NUnitTestCaseBuilder.NUnitTestCaseBuilder ( )
inline

Constructs an NUnitTestCaseBuilder

Member Function Documentation

TestMethod NUnit.Framework.Internal.Builders.NUnitTestCaseBuilder.BuildTestMethod ( IMethodInfo  method,
Test  parentSuite,
TestCaseParameters  parms 
)
inline
static bool NUnit.Framework.Internal.Builders.NUnitTestCaseBuilder.CheckTestMethodSignature ( TestMethod  testMethod,
TestCaseParameters  parms 
)
inlinestaticprivate

Helper method that checks the signature of a TestMethod and any supplied parameters to determine if the test is valid.

Currently, NUnitTestMethods are required to be public, non-abstract methods, either static or instance, returning void. They may take arguments but the _values must be provided or the TestMethod is not considered runnable.

Methods not meeting these criteria will be marked as non-runnable and the method will return false in that case.

Parameters
testMethodThe TestMethod to be checked. If it is found to be non-runnable, it will be modified.
parmsParameters to be used for this test, or null
Returns
True if the method signature is valid, false if not

The return value is no longer used internally, but is retained for testing purposes.

References NUnit.Framework.Internal.TestParameters.Arguments, NUnit.Framework.Internal.TypeHelper.ConvertArgumentList(), NUnit.Framework.Interfaces.ITypeInfo.GetGenericTypeDefinition(), NUnit.Framework.Interfaces.IMethodInfo.GetParameters(), NUnit.Framework.Internal.GenericMethodHelper.GetTypeArguments(), NUnit.Framework.Interfaces.IMethodInfo.IsAbstract, NUnit.Framework.Interfaces.IMethodInfo.IsGenericMethodDefinition, NUnit.Framework.Interfaces.ITypeInfo.IsGenericType, NUnit.Framework.Interfaces.IMethodInfo.IsPublic, NUnit.Framework.Interfaces.ITypeInfo.IsType(), NUnit.Framework.Internal.Test.Method, and NUnit.Framework.Internal.TypeHelper.NonmatchingType.

static bool NUnit.Framework.Internal.Builders.NUnitTestCaseBuilder.MarkAsNotRunnable ( TestMethod  testMethod,
string  reason 
)
inlinestaticprivate

Member Data Documentation

const string NUnit.Framework.Internal.Builders.NUnitTestCaseBuilder.DEFAULT_TEST_NAME_PATTERN = "{m}{a:40}"
private
readonly Randomizer NUnit.Framework.Internal.Builders.NUnitTestCaseBuilder._randomizer = Randomizer.CreateRandomizer()
private
readonly TestNameGenerator NUnit.Framework.Internal.Builders.NUnitTestCaseBuilder._nameGenerator
private

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