TestContext Class

Definition

Used to store information that is provided to unit tests.

public abstract class TestContext
type TestContext = class
Public MustInherit Class TestContext
Inheritance
TestContext

Constructors

TestContext()

Properties

CurrentTestOutcome

Gets the current test outcome.

DataConnection

Gets current data connection row when test is used for data driven testing.

DataRow

Gets the current data row when test is used for data driven testing.

DeploymentDirectory

Gets directory for files deployed for the test run. Typically a subdirectory of TestRunDirectory.

FullyQualifiedTestClassName

Gets the Fully-qualified name of the class containing the test method currently being executed

Properties

Gets test properties for a test.

ResultsDirectory

Gets base directory for results from the test run. Typically a subdirectory of TestRunDirectory.

TestDeploymentDir

Gets directory for files deployed for the test run. Typically a subdirectory of TestRunDirectory. Same as DeploymentDirectory. Use that property instead.

TestDir

Gets base directory for the test run, under which deployed files and result files are stored. Same as TestRunDirectory. Use that property instead.

TestLogsDir

Gets directory for test run result files. Typically a subdirectory of ResultsDirectory. Same as TestRunResultsDirectory. Use that property for test run result files, or TestResultsDirectory for test-specific result files instead.

TestName

Gets the name of the test method currently being executed

TestResultsDirectory

Gets directory for test result files.

TestRunDirectory

Gets base directory for the test run, under which deployed files and result files are stored.

TestRunResultsDirectory

Gets directory for test run result files. Typically a subdirectory of ResultsDirectory.

Methods

AddResultFile(String)

Adds a file name to the list in TestResult.ResultFileNames

BeginTimer(String)

Begins a timer with the specified name

EndTimer(String)

Ends a timer with the specified name

WriteLine(String)

Used to write trace messages while the test is running

WriteLine(String, Object[])

Used to write trace messages while the test is running

Applies to