C# Класс 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.
Наследование: LongLivedMarshalByRefObject
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AddSetting void
CountTests void
ExploreTests void
GetProcessorArchitecture string
Initialize void
LoadTests void
RunAsync void
RunAsync void
RunTests void
StopRun void

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

CountTests() публичный Метод

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
Результат int

ExploreTests() публичный Метод

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
Результат string

FrameworkController() публичный Метод

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
Результат System

FrameworkController() публичный Метод

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
Результат System

FrameworkController() публичный Метод

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
Результат System

FrameworkController() публичный Метод

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
Результат System

InsertEnvironmentElement() публичный статический Метод

Inserts environment element
public static InsertEnvironmentElement ( TNode targetNode ) : TNode
targetNode TNode Target node
Результат TNode

InsertSettingsElement() публичный статический Метод

Inserts settings element
public static InsertSettingsElement ( TNode targetNode, object>.IDictionary settings ) : TNode
targetNode TNode Target node
settings object>.IDictionary Settings dictionary
Результат TNode

LoadTests() публичный Метод

Loads the tests in the assembly
public LoadTests ( ) : string
Результат string

RunTests() публичный Метод

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
Результат string

RunTests() публичный Метод

Runs the tests in an assembly
public RunTests ( string filter ) : string
filter string A string containing the XML representation of the filter to use
Результат string

StopRun() публичный Метод

Stops the test run
public StopRun ( bool force ) : void
force bool True to force the stop, false for a cooperative stop
Результат void