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.Api.FrameworkController Class Reference

FrameworkController provides a facade for use in loading, browsing and running tests without requiring a reference to the NUnit framework. All calls are encapsulated in constructors for this class and its nested classes, which only require the types of the Common Type System as arguments. More...

+ Inheritance diagram for NUnit.Framework.Api.FrameworkController:
+ Collaboration diagram for NUnit.Framework.Api.FrameworkController:

Classes

class  CountTestsAction
 CountTestsAction counts the number of test cases in the loaded TestSuite held by the FrameworkController. More...
 
class  ExploreTestsAction
 ExploreTestsAction returns info about the tests in an assembly More...
 
class  FrameworkControllerAction
 FrameworkControllerAction is the base class for all actions performed against a FrameworkController. More...
 
class  LoadTestsAction
 LoadTestsAction loads a test into the FrameworkController More...
 
class  RunAsyncAction
 RunAsyncAction initiates an asynchronous test run, returning immediately More...
 
class  RunTestsAction
 RunTestsAction runs the loaded TestSuite held by the FrameworkController. More...
 
class  StopRunAction
 StopRunAction stops an ongoing run. More...
 

Public Member Functions

 FrameworkController (string assemblyNameOrPath, string idPrefix, IDictionary settings)
 Construct a FrameworkController using the default builder and runner. More...
 
 FrameworkController (Assembly assembly, string idPrefix, IDictionary settings)
 Construct a FrameworkController using the default builder and runner. More...
 
 FrameworkController (string assemblyNameOrPath, string idPrefix, IDictionary settings, string runnerType, string builderType)
 Construct a FrameworkController, specifying the types to be used for the runner and builder. This constructor is provided for purposes of development. More...
 
 FrameworkController (Assembly assembly, string idPrefix, IDictionary settings, string runnerType, string builderType)
 Construct a FrameworkController, specifying the types to be used for the runner and builder. This constructor is provided for purposes of development. More...
 
- Public Member Functions inherited from NUnit.Framework.Compatibility.LongLivedMarshalByRefObject
override object InitializeLifetimeService ()
 Obtains a lifetime service object to control the lifetime policy for this instance. More...
 

Static Public Member Functions

static TNode InsertEnvironmentElement (TNode targetNode)
 Inserts environment element More...
 
static TNode InsertSettingsElement (TNode targetNode, IDictionary settings)
 Inserts settings element More...
 

Properties

ITestAssemblyBuilder Builder [get, private set]
 Gets the ITestAssemblyBuilder used by this controller instance. More...
 
ITestAssemblyRunner Runner [get, private set]
 Gets the ITestAssemblyRunner used by this controller instance. More...
 
string AssemblyNameOrPath [get, private set]
 Gets the AssemblyName or the path for which this FrameworkController was created More...
 
Assembly Assembly [get, private set]
 Gets the Assembly for which this More...
 
IDictionary Settings [get, private set]
 Gets a dictionary of settings for the FrameworkController More...
 

Private Member Functions

void Initialize (string assemblyPath, IDictionary settings)
 
void LoadTests (ICallbackEventHandler handler)
 
void ExploreTests (ICallbackEventHandler handler, string filter)
 
void RunTests (ICallbackEventHandler handler, string filter)
 
void RunAsync (ICallbackEventHandler handler, string filter)
 
void StopRun (ICallbackEventHandler handler, bool force)
 
void CountTests (ICallbackEventHandler handler, string filter)
 

Static Private Member Functions

static string GetProcessorArchitecture ()
 
static void AddSetting (TNode settingsNode, string name, object value)
 

Private Attributes

const string LOG_FILE_FORMAT = "InternalTrace.{0}.{1}.log"
 
Assembly _testAssembly
 

Detailed Description

FrameworkController provides a facade for use in loading, browsing and running tests without requiring a reference to the NUnit framework. All calls are encapsulated in constructors for this class and its nested classes, which only require the types of the Common Type System as arguments.

The controller supports four actions: Load, Explore, Count and Run. They are intended to be called by a driver, which should allow for proper sequencing of calls. Load must be called before any of the other actions. The driver may support other actions, such as reload on run, by combining these calls.

Constructor & Destructor Documentation

NUnit.Framework.Api.FrameworkController.FrameworkController ( string  assemblyNameOrPath,
string  idPrefix,
IDictionary  settings 
)
inline

Construct a FrameworkController using the default builder and runner.

Parameters
assemblyNameOrPathThe AssemblyName or path to the test assembly
idPrefixA prefix used for all test ids created under this controller.
settingsA Dictionary of settings to use in loading and running the tests
NUnit.Framework.Api.FrameworkController.FrameworkController ( Assembly  assembly,
string  idPrefix,
IDictionary  settings 
)
inline

Construct a FrameworkController using the default builder and runner.

Parameters
assemblyThe test assembly
idPrefixA prefix used for all test ids created under this controller.
settingsA Dictionary of settings to use in loading and running the tests
NUnit.Framework.Api.FrameworkController.FrameworkController ( string  assemblyNameOrPath,
string  idPrefix,
IDictionary  settings,
string  runnerType,
string  builderType 
)
inline

Construct a FrameworkController, specifying the types to be used for the runner and builder. This constructor is provided for purposes of development.

Parameters
assemblyNameOrPathThe full AssemblyName or the path to the test assembly
idPrefixA prefix used for all test ids created under this controller.
settingsA Dictionary of settings to use in loading and running the tests
runnerTypeThe Type of the test runner
builderTypeThe Type of the test builder

References NUnit.Framework.Internal.Reflect.Construct().

NUnit.Framework.Api.FrameworkController.FrameworkController ( Assembly  assembly,
string  idPrefix,
IDictionary  settings,
string  runnerType,
string  builderType 
)
inline

Construct a FrameworkController, specifying the types to be used for the runner and builder. This constructor is provided for purposes of development.

Parameters
assemblyThe test assembly
idPrefixA prefix used for all test ids created under this controller.
settingsA Dictionary of settings to use in loading and running the tests
runnerTypeThe Type of the test runner
builderTypeThe Type of the test builder

Member Function Documentation

void NUnit.Framework.Api.FrameworkController.Initialize ( string  assemblyPath,
IDictionary  settings 
)
inlineprivate
void NUnit.Framework.Api.FrameworkController.LoadTests ( ICallbackEventHandler  handler)
inlineprivate
void NUnit.Framework.Api.FrameworkController.ExploreTests ( ICallbackEventHandler  handler,
string  filter 
)
inlineprivate
void NUnit.Framework.Api.FrameworkController.RunTests ( ICallbackEventHandler  handler,
string  filter 
)
inlineprivate
void NUnit.Framework.Api.FrameworkController.RunAsync ( ICallbackEventHandler  handler,
string  filter 
)
inlineprivate
void NUnit.Framework.Api.FrameworkController.StopRun ( ICallbackEventHandler  handler,
bool  force 
)
inlineprivate
void NUnit.Framework.Api.FrameworkController.CountTests ( ICallbackEventHandler  handler,
string  filter 
)
inlineprivate
static TNode NUnit.Framework.Api.FrameworkController.InsertEnvironmentElement ( TNode  targetNode)
inlinestatic

Inserts environment element

Parameters
targetNodeTarget node
Returns
The new node

Referenced by NUnitLite.NUnit3XmlOutputWriter.WriteXmlResultOutput().

static string NUnit.Framework.Api.FrameworkController.GetProcessorArchitecture ( )
inlinestaticprivate
static TNode NUnit.Framework.Api.FrameworkController.InsertSettingsElement ( TNode  targetNode,
IDictionary  settings 
)
inlinestatic

Inserts settings element

Parameters
targetNodeTarget node
settingsSettings dictionary
Returns
The new node

References NUnit.Framework.Interfaces.TNode.ChildNodes, and NUnit.Common.PackageSettings.NumberOfTestWorkers.

Referenced by NUnitLite.NUnit3XmlOutputWriter.WriteXmlResultOutput().

static void NUnit.Framework.Api.FrameworkController.AddSetting ( TNode  settingsNode,
string  name,
object  value 
)
inlinestaticprivate

Member Data Documentation

const string NUnit.Framework.Api.FrameworkController.LOG_FILE_FORMAT = "InternalTrace.{0}.{1}.log"
private
Assembly NUnit.Framework.Api.FrameworkController._testAssembly
private

Property Documentation

ITestAssemblyBuilder NUnit.Framework.Api.FrameworkController.Builder
getprivate set

Gets the ITestAssemblyBuilder used by this controller instance.

The builder.

Referenced by NUnit.Framework.Api.FrameworkControllerTests.ConstructController().

ITestAssemblyRunner NUnit.Framework.Api.FrameworkController.Runner
getprivate set

Gets the ITestAssemblyRunner used by this controller instance.

The runner.

Referenced by NUnit.Framework.Api.FrameworkControllerTests.ConstructController().

string NUnit.Framework.Api.FrameworkController.AssemblyNameOrPath
getprivate set

Gets the AssemblyName or the path for which this FrameworkController was created

Referenced by NUnit.Framework.Api.FrameworkControllerTests.ConstructController().

Assembly NUnit.Framework.Api.FrameworkController.Assembly
getprivate set

Gets the Assembly for which this

IDictionary NUnit.Framework.Api.FrameworkController.Settings
getprivate set

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