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

Implementation of ITestAssemblyRunner More...

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

Public Member Functions

 NUnitTestAssemblyRunner (ITestAssemblyBuilder builder)
 Initializes a new instance of the NUnitTestAssemblyRunner class. More...
 
ITest Load (string assemblyName, IDictionary settings)
 Loads the tests found in an Assembly More...
 
ITest Load (Assembly assembly, IDictionary settings)
 Loads the tests found in an Assembly More...
 
int CountTestCases (ITestFilter filter)
 Count Test Cases using a filter More...
 
ITestResult Run (ITestListener listener, ITestFilter filter)
 Run selected tests and return a test result. The test is run synchronously, and the listener interface is notified as it progresses. More...
 
void RunAsync (ITestListener listener, ITestFilter filter)
 Run selected tests asynchronously, notifying the listener interface as it progresses. More...
 
bool WaitForCompletion (int timeout)
 Wait for the ongoing run to complete. More...
 
void StartRun (ITestListener listener)
 Initiate the test run. More...
 
void StopRun (bool force)
 Signal any test run that is in process to stop. Return without error if no test is running. More...
 
- Public Member Functions inherited from NUnit.Framework.Api.ITestAssemblyRunner
ITest Load (string assemblyName, System.Collections.IDictionary settings)
 Loads the tests found in an Assembly, returning an indication of whether or not the load succeeded. More...
 
ITest Load (Assembly assembly, System.Collections.IDictionary settings)
 Loads the tests found in an Assembly, returning an indication of whether or not the load succeeded. More...
 

Properties

ITest LoadedTest [get, private set]
 The tree of tests that was loaded by the builder More...
 
ITestResult Result [get]
 The test result, if a run has completed More...
 
bool IsTestLoaded [get]
 Indicates whether a test is loaded More...
 
bool IsTestRunning [get]
 Indicates whether a test is running More...
 
bool IsTestComplete [get]
 Indicates whether a test run is complete More...
 
IDictionary Settings [get, set]
 Our settings, specified when loading the assembly More...
 
WorkItem TopLevelWorkItem [get, set]
 The top level WorkItem created for the assembly as a whole More...
 
TestExecutionContext Context [get, set]
 The TestExecutionContext for the top level WorkItem More...
 
- Properties inherited from NUnit.Framework.Api.ITestAssemblyRunner
ITest LoadedTest [get]
 Gets the tree of loaded tests, or null if no tests have been loaded. More...
 
ITestResult Result [get]
 Gets the tree of test results, if the test run is completed, otherwise null. More...
 
bool IsTestLoaded [get]
 Indicates whether a test has been loaded More...
 
bool IsTestRunning [get]
 Indicates whether a test is currently running More...
 
bool IsTestComplete [get]
 Indicates whether a test run is complete More...
 

Private Member Functions

void CreateTestExecutionContext (ITestListener listener)
 Create the initial TestExecutionContext used to run tests More...
 
void OnRunCompleted (object sender, EventArgs e)
 Handle the the Completed event for the top level work item More...
 
int CountTestCases (ITest test, ITestFilter filter)
 

Static Private Member Functions

static int GetInitialSeed (IDictionary settings)
 
static void PauseBeforeRun ()
 

Private Attributes

ITestAssemblyBuilder _builder
 
AutoResetEvent _runComplete = new AutoResetEvent(false)
 
TextWriter _savedOut
 
TextWriter _savedErr
 

Static Private Attributes

static Logger log = InternalTrace.GetLogger("DefaultTestAssemblyRunner")
 

Detailed Description

Implementation of ITestAssemblyRunner

Constructor & Destructor Documentation

NUnit.Framework.Api.NUnitTestAssemblyRunner.NUnitTestAssemblyRunner ( ITestAssemblyBuilder  builder)
inline

Initializes a new instance of the NUnitTestAssemblyRunner class.

Parameters
builderThe builder.

Member Function Documentation

ITest NUnit.Framework.Api.NUnitTestAssemblyRunner.Load ( string  assemblyName,
IDictionary  settings 
)
inline

Loads the tests found in an Assembly

Parameters
assemblyNameFile name of the assembly to load
settingsDictionary of option settings for loading the assembly
Returns
True if the load was successful

References NUnit.Framework.Api.ITestAssemblyBuilder.Build(), and NUnit.Framework.Internal.Randomizer.InitialSeed.

ITest NUnit.Framework.Api.NUnitTestAssemblyRunner.Load ( Assembly  assembly,
IDictionary  settings 
)
inline

Loads the tests found in an Assembly

Parameters
assemblyThe assembly to load
settingsDictionary of option settings for loading the assembly
Returns
True if the load was successful

References NUnit.Framework.Api.ITestAssemblyBuilder.Build(), and NUnit.Framework.Internal.Randomizer.InitialSeed.

int NUnit.Framework.Api.NUnitTestAssemblyRunner.CountTestCases ( ITestFilter  filter)
inline

Count Test Cases using a filter

Parameters
filterThe filter to apply
Returns
The number of test cases found

Implements NUnit.Framework.Api.ITestAssemblyRunner.

ITestResult NUnit.Framework.Api.NUnitTestAssemblyRunner.Run ( ITestListener  listener,
ITestFilter  filter 
)
inline

Run selected tests and return a test result. The test is run synchronously, and the listener interface is notified as it progresses.

Parameters
listenerInterface to receive EventListener notifications.
filterA test filter used to select tests to be run
Returns

Implements NUnit.Framework.Api.ITestAssemblyRunner.

void NUnit.Framework.Api.NUnitTestAssemblyRunner.RunAsync ( ITestListener  listener,
ITestFilter  filter 
)
inline

Run selected tests asynchronously, notifying the listener interface as it progresses.

Parameters
listenerInterface to receive EventListener notifications.
filterA test filter used to select tests to be run

RunAsync is a template method, calling various abstract and virtual methods to be overridden by derived classes.

Implements NUnit.Framework.Api.ITestAssemblyRunner.

References NUnit.Framework.Internal.Execution.WorkItem.CreateWorkItem(), NUnit.Common.Logger.Info(), and NUnit.Framework.Internal.Execution.WorkItem.InitializeContext().

bool NUnit.Framework.Api.NUnitTestAssemblyRunner.WaitForCompletion ( int  timeout)
inline

Wait for the ongoing run to complete.

Parameters
timeoutTime to wait in milliseconds
Returns
True if the run completed, otherwise false

Implements NUnit.Framework.Api.ITestAssemblyRunner.

void NUnit.Framework.Api.NUnitTestAssemblyRunner.StartRun ( ITestListener  listener)
inline
void NUnit.Framework.Api.NUnitTestAssemblyRunner.StopRun ( bool  force)
inline

Signal any test run that is in process to stop. Return without error if no test is running.

Parameters
forceIf true, kill any test-running threads

Implements NUnit.Framework.Api.ITestAssemblyRunner.

void NUnit.Framework.Api.NUnitTestAssemblyRunner.CreateTestExecutionContext ( ITestListener  listener)
inlineprivate

Create the initial TestExecutionContext used to run tests

Parameters
listenerThe ITestListener specified in the RunAsync call

References NUnit.Common.PackageSettings.DefaultTimeout, NUnit.Framework.Internal.PropertyNames.ParallelScope, NUnit.Common.PackageSettings.StopOnError, and NUnit.Common.PackageSettings.WorkDirectory.

void NUnit.Framework.Api.NUnitTestAssemblyRunner.OnRunCompleted ( object  sender,
EventArgs  e 
)
inlineprivate

Handle the the Completed event for the top level work item

int NUnit.Framework.Api.NUnitTestAssemblyRunner.CountTestCases ( ITest  test,
ITestFilter  filter 
)
inlineprivate
static int NUnit.Framework.Api.NUnitTestAssemblyRunner.GetInitialSeed ( IDictionary  settings)
inlinestaticprivate
static void NUnit.Framework.Api.NUnitTestAssemblyRunner.PauseBeforeRun ( )
inlinestaticprivate

Member Data Documentation

Logger NUnit.Framework.Api.NUnitTestAssemblyRunner.log = InternalTrace.GetLogger("DefaultTestAssemblyRunner")
staticprivate
ITestAssemblyBuilder NUnit.Framework.Api.NUnitTestAssemblyRunner._builder
private
AutoResetEvent NUnit.Framework.Api.NUnitTestAssemblyRunner._runComplete = new AutoResetEvent(false)
private
TextWriter NUnit.Framework.Api.NUnitTestAssemblyRunner._savedOut
private
TextWriter NUnit.Framework.Api.NUnitTestAssemblyRunner._savedErr
private

Property Documentation

ITest NUnit.Framework.Api.NUnitTestAssemblyRunner.LoadedTest
getprivate set

The tree of tests that was loaded by the builder

ITestResult NUnit.Framework.Api.NUnitTestAssemblyRunner.Result
get

The test result, if a run has completed

bool NUnit.Framework.Api.NUnitTestAssemblyRunner.IsTestLoaded
get

Indicates whether a test is loaded

bool NUnit.Framework.Api.NUnitTestAssemblyRunner.IsTestRunning
get

Indicates whether a test is running

bool NUnit.Framework.Api.NUnitTestAssemblyRunner.IsTestComplete
get

Indicates whether a test run is complete

IDictionary NUnit.Framework.Api.NUnitTestAssemblyRunner.Settings
getsetprivate

Our settings, specified when loading the assembly

WorkItem NUnit.Framework.Api.NUnitTestAssemblyRunner.TopLevelWorkItem
getsetprivate

The top level WorkItem created for the assembly as a whole

TestExecutionContext NUnit.Framework.Api.NUnitTestAssemblyRunner.Context
getsetprivate

The TestExecutionContext for the top level WorkItem


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