Share via


DatabaseTestService.OpenExecutionContext Method

Opens the ConnectionContext to be used for a test's execution.

Namespace:  Microsoft.VisualStudio.TeamSystem.Data.UnitTesting
Assembly:  Microsoft.VisualStudio.TeamSystem.Data.UnitTesting (in Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.dll)

Syntax

'Declaration
Public Overridable Function OpenExecutionContext As ConnectionContext
'Usage
Dim instance As DatabaseTestService
Dim returnValue As ConnectionContext

returnValue = instance.OpenExecutionContext()
public virtual ConnectionContext OpenExecutionContext()
public:
virtual ConnectionContext^ OpenExecutionContext()
public function OpenExecutionContext() : ConnectionContext

Return Value

Type: Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.ConnectionContext

Exceptions

Exception Condition
AssertFailedException

If context is nulla null reference (Nothing in Visual Basic).

Remarks

This configuration is read from the app.config file. It will throw an AssertFailedException if there is an error reading the connection context from the app.config file. It will also throw an assert if the provider specified in the GenerateData or DeployDatabaseProject method is invalid. Other providers are supported here as long as the provider implements the appropriate classes in System.Data (for example, DbProviderFactory, DbConnection, DbDataReader, DbCommand, and so on).

Permissions

See Also

Reference

DatabaseTestService Class

DatabaseTestService Members

Microsoft.VisualStudio.TeamSystem.Data.UnitTesting Namespace