Udostępnij za pośrednictwem


TestContext Members

Include Protected Members
Include Inherited Members

Used to store information that is provided to unit tests.

The TestContext type exposes the following members.

Constructors

 

Name

Description

Protected method

TestContext

Initializes a new instance of an object that derives from the TestContext class.

Top

Methods

 

Name

Description

Public method

AddResultFile

When overridden in a derived class, adds a file name to the list in TestResult.ResultFileNames.

Public method

BeginTimer

When overridden in a derived class, begins a timer with the specified name.

Public method

EndTimer

When overridden in a derived class, ends a timer with the specified name.

Public method

Equals

Determines whether the specified Object is equal to the current Object. (Inherited from Object.)

Protected method

Finalize

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)

Public method

GetHashCode

Serves as a hash function for a particular type. (Inherited from Object.)

Public method

GetType

Gets the type of the current instance. (Inherited from Object.)

Protected method

MemberwiseClone

Creates a shallow copy of the current Object. (Inherited from Object.)

Public method

ToString

Returns a string that represents the current object. (Inherited from Object.)

Public method

WriteLine

When overridden in a derived class, used to write trace messages while the test is running.

Top

Fields

 

Name

Description

Public fieldStatic member

AspNetDevelopmentServerPrefix

Represents the prefix for ASP.NET Development Server.

Top

Properties

 

Name

Description

Public property

CurrentTestOutcome

You can use this property in a TestCleanup method to determine the outcome of a test that has run.

Public property

DataConnection

When overridden in a derived class, gets the current data connection when the test is used for data driven testing.

Public property

DataRow

When overridden in a derived class, gets the current data row when test is used for data driven testing.

Public property

Properties

When overridden in a derived class, gets the test properties.

Public property

RequestedPage

Gets the requested page.

Public property

TestDeploymentDir

Gets the path to the test deployment directory.

Public property

TestDir

Gets the path to the test directory.

Public property

TestLogsDir

Gets the path to the test log directory.

Public property

TestName

Gets the test name.

Top

See Also

Reference

TestContext Class

Microsoft.VisualStudio.TestTools.UnitTesting Namespace