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.
Gets the current context.
Saves or restores the CurrentCulture
Gets or sets the current IPrincipal for the Thread.
Gets or sets the current test result
Gets or sets the current test
Saves or restores the CurrentUICulture
Gets an enum indicating whether a stop has been requested.
The ParallelScope to be used by tests running in this context
Gets the RandomGenerator specific to this Test
The time the current test started in Ticks
The time the current test started execution
Get or set indicator that run should stop on the first error
Gets or sets the test case timeout value
The current test object - that is the user fixture
object on which tests are being executed.
Gets a list of ITestActions set by upstream tests
Get or set the working directory
public TestExecutionContext()
Initializes a new instance of the TestExecutionContext class.
Initializes a new instance of the TestExecutionContext class.
Clear the current context. This is provided to
prevent "leakage" of the CallContext containing
the current context back to any runners.
Get the current context or return null if none is found.
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.
Increments the assert count by one.
Increments the assert count by a specified amount.
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.