The TestContext type exposes the following members.

Methods

  NameDescription
AddAssertCount
Adds the specified amount to the assert count atomically.
AddMetadata
Adds metadata to the step that is running in the context.
AutoExecuteOverloaded.
Enter
Enters this context with the current thread.
EnterContext
Enters the specified context with the current thread.
Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Finalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
GetThreadDefaultContext
Gets the default context for the specified thread.
GetType
Gets the Type of the current instance.
(Inherited from Object.)
IncrementAssertCount
Increments the assert count atomically.
IsTriggerEventSatisfied
Returns true if a trigger event has been satisfied.
MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
RunStep
Performs an action as a new step within the current context and associates it with the specified code reference. Does not verify the outcome of the step.
RunStepAndVerifyOutcome
Performs an action as a new step within the current context and associates it with the specified code reference. Verifies that the step produced the expected outcome.
SetInterimOutcome
Sets the step's interim Outcome.
SetThreadDefaultContext
Sets the default context for the specified thread.
ToString
Returns a String that represents the current Object.
(Inherited from Object.)

Extension Methods

  NameDescription
FormatOverloaded.

Properties

  NameDescription
AssertCount
Gets the current assertion count.
CurrentContext
Gets the context of the current thread, or null if there is no current context.
Data
Gets the user data collection associated with the context. It may be used to associate arbitrary key/value pairs with the context.
GlobalContext
Gets the global context of the environment, or null if there is no such context.
IsFinished
Returns true if the step associated with the context has finished execution and completed all Finishing actions.
LifecyclePhase
Gets or sets the lifecycle phase the context is in.
LogWriter
Gets the log writer for this context.
Outcome
Gets the step's outcome or its interim outcome if the test is still running.
Parent
Gets the parent context or null if this context has no parent.
Result
Gets a copy of the step's final result or null if the test has not finished yet.
Sandbox
Gets the sandbox of the test step, or null if none.
Test
Gets the test associated with the context.
TestStep
Gets the test step associated with the context.

Events

  NameDescription
Finishing
The Finishing event is raised when the test is finishing to provide clients with an opportunity to perform additional clean up tasks after all ordinary test processing is finished.

See Also