C# Class NUnit.Framework.Api.FrameworkController

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.
Inheritance: LongLivedMarshalByRefObject
Afficher le fichier Open project: nunit/nunit Class Usage Examples

Private Properties

Свойство Type Description
AddSetting void
CountTests void
ExploreTests void
GetProcessorArchitecture string
Initialize void
LoadTests void
RunAsync void
RunAsync void
RunTests void
StopRun void

Méthodes publiques

Méthode Description
CountTests ( string filter ) : int

Counts the number of test cases in the loaded TestSuite

ExploreTests ( string filter ) : string

Returns info about the tests in an assembly

FrameworkController ( Assembly assembly, string idPrefix, IDictionary settings ) : System

Construct a FrameworkController using the default builder and runner.

FrameworkController ( Assembly assembly, string idPrefix, IDictionary settings, string runnerType, string builderType ) : System

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

FrameworkController ( string assemblyNameOrPath, string idPrefix, IDictionary settings ) : System

Construct a FrameworkController using the default builder and runner.

FrameworkController ( string assemblyNameOrPath, string idPrefix, IDictionary settings, string runnerType, string builderType ) : System

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

InsertEnvironmentElement ( TNode targetNode ) : TNode

Inserts environment element

InsertSettingsElement ( TNode targetNode, object>.IDictionary settings ) : TNode

Inserts settings element

LoadTests ( ) : string

Loads the tests in the assembly

RunTests ( Action callback, string filter ) : string

Runs the tests in an assembly synchronously reporting back the test results through the callback or through the return value

RunTests ( string filter ) : string

Runs the tests in an assembly

StopRun ( bool force ) : void

Stops the test run

Private Methods

Méthode Description
AddSetting ( TNode settingsNode, string name, object value ) : void
CountTests ( ICallbackEventHandler handler, string filter ) : void
ExploreTests ( ICallbackEventHandler handler, string filter ) : void
GetProcessorArchitecture ( ) : string
Initialize ( string assemblyPath, IDictionary settings ) : void
LoadTests ( ICallbackEventHandler handler ) : void
RunAsync ( Action callback, string filter ) : void

Runs the tests in an assembly asynchronously reporting back the test results through the callback

RunAsync ( ICallbackEventHandler handler, string filter ) : void
RunTests ( ICallbackEventHandler handler, string filter ) : void
StopRun ( ICallbackEventHandler handler, bool force ) : void

Method Details

CountTests() public méthode

Counts the number of test cases in the loaded TestSuite
public CountTests ( string filter ) : int
filter string A string containing the XML representation of the filter to use
Résultat int

ExploreTests() public méthode

Returns info about the tests in an assembly
public ExploreTests ( string filter ) : string
filter string A string containing the XML representation of the filter to use
Résultat string

FrameworkController() public méthode

Construct a FrameworkController using the default builder and runner.
public FrameworkController ( Assembly assembly, string idPrefix, IDictionary settings ) : System
assembly System.Reflection.Assembly The test assembly
idPrefix string A prefix used for all test ids created under this controller.
settings IDictionary A Dictionary of settings to use in loading and running the tests
Résultat System

FrameworkController() public méthode

Construct a FrameworkController, specifying the types to be used for the runner and builder. This constructor is provided for purposes of development.
public FrameworkController ( Assembly assembly, string idPrefix, IDictionary settings, string runnerType, string builderType ) : System
assembly System.Reflection.Assembly The test assembly
idPrefix string A prefix used for all test ids created under this controller.
settings IDictionary A Dictionary of settings to use in loading and running the tests
runnerType string The Type of the test runner
builderType string The Type of the test builder
Résultat System

FrameworkController() public méthode

Construct a FrameworkController using the default builder and runner.
public FrameworkController ( string assemblyNameOrPath, string idPrefix, IDictionary settings ) : System
assemblyNameOrPath string The AssemblyName or path to the test assembly
idPrefix string A prefix used for all test ids created under this controller.
settings IDictionary A Dictionary of settings to use in loading and running the tests
Résultat System

FrameworkController() public méthode

Construct a FrameworkController, specifying the types to be used for the runner and builder. This constructor is provided for purposes of development.
public FrameworkController ( string assemblyNameOrPath, string idPrefix, IDictionary settings, string runnerType, string builderType ) : System
assemblyNameOrPath string The full AssemblyName or the path to the test assembly
idPrefix string A prefix used for all test ids created under this controller.
settings IDictionary A Dictionary of settings to use in loading and running the tests
runnerType string The Type of the test runner
builderType string The Type of the test builder
Résultat System

InsertEnvironmentElement() public static méthode

Inserts environment element
public static InsertEnvironmentElement ( TNode targetNode ) : TNode
targetNode TNode Target node
Résultat TNode

InsertSettingsElement() public static méthode

Inserts settings element
public static InsertSettingsElement ( TNode targetNode, object>.IDictionary settings ) : TNode
targetNode TNode Target node
settings object>.IDictionary Settings dictionary
Résultat TNode

LoadTests() public méthode

Loads the tests in the assembly
public LoadTests ( ) : string
Résultat string

RunTests() public méthode

Runs the tests in an assembly synchronously reporting back the test results through the callback or through the return value
public RunTests ( Action callback, string filter ) : string
callback Action The callback that receives the test results
filter string A string containing the XML representation of the filter to use
Résultat string

RunTests() public méthode

Runs the tests in an assembly
public RunTests ( string filter ) : string
filter string A string containing the XML representation of the filter to use
Résultat string

StopRun() public méthode

Stops the test run
public StopRun ( bool force ) : void
force bool True to force the stop, false for a cooperative stop
Résultat void