C# Class NUnit.Framework.Internal.TestExecutionContext

Helper class used to save and restore certain static or singleton settings in the environment that affect tests or which might be changed by the user tests. An internal class is used to hold settings and a stack of these objects is pushed and popped as Save and Restore are called.
Inheritance: System.MarshalByRefObject, ILogicalThreadAffinative
Afficher le fichier Open project: nunit/nunit Class Usage Examples

Private Properties

Свойство Type Description
CreateIsolatedContext TestExecutionContext
InitializeLifetimeService object

Méthodes publiques

Méthode Description
AddFormatter ( ValueFormatterFactory formatterFactory ) : void

Adds a new ValueFormatterFactory to the chain of formatters

ClearCurrentContext ( ) : void

Clear the current context. This is provided to prevent "leakage" of the CallContext containing the current context back to any runners.

EstablishExecutionEnvironment ( ) : void

Set up the execution environment to match a context. Note that we may be running on the same thread where the context was initially created or on a different thread.

GetTestExecutionContext ( ) : TestExecutionContext

Get the current context or return null if none is found.

IncrementAssertCount ( ) : void

Increments the assert count by one.

IncrementAssertCount ( int count ) : void

Increments the assert count by a specified amount.

TestExecutionContext ( ) : System

Initializes a new instance of the TestExecutionContext class.

TestExecutionContext ( TestExecutionContext other ) : System

Initializes a new instance of the TestExecutionContext class.

UpdateContextFromEnvironment ( ) : void

Record any changes in the environment made by the test code in the execution context so it will be passed on to lower level tests.

Private Methods

Méthode Description
CreateIsolatedContext ( ) : TestExecutionContext
InitializeLifetimeService ( ) : object

Method Details

AddFormatter() public méthode

Adds a new ValueFormatterFactory to the chain of formatters
public AddFormatter ( ValueFormatterFactory formatterFactory ) : void
formatterFactory ValueFormatterFactory The new factory
Résultat void

ClearCurrentContext() public static méthode

Clear the current context. This is provided to prevent "leakage" of the CallContext containing the current context back to any runners.
public static ClearCurrentContext ( ) : void
Résultat void

EstablishExecutionEnvironment() public méthode

Set up the execution environment to match a context. Note that we may be running on the same thread where the context was initially created or on a different thread.
public EstablishExecutionEnvironment ( ) : void
Résultat void

GetTestExecutionContext() public static méthode

Get the current context or return null if none is found.

IncrementAssertCount() public méthode

Increments the assert count by one.
public IncrementAssertCount ( ) : void
Résultat void

IncrementAssertCount() public méthode

Increments the assert count by a specified amount.
public IncrementAssertCount ( int count ) : void
count int
Résultat void

TestExecutionContext() public méthode

Initializes a new instance of the TestExecutionContext class.
public TestExecutionContext ( ) : System
Résultat System

TestExecutionContext() public méthode

Initializes a new instance of the TestExecutionContext class.
public TestExecutionContext ( TestExecutionContext other ) : System
other TestExecutionContext An existing instance of TestExecutionContext.
Résultat System

UpdateContextFromEnvironment() public méthode

Record any changes in the environment made by the test code in the execution context so it will be passed on to lower level tests.
public UpdateContextFromEnvironment ( ) : void
Résultat void