TestRunConfiguration.SetTestEnvironment Method

Sets the test environment to use in a test run by using these test settings and the controller that hosts the test environment.

Namespace:  Microsoft.VisualStudio.TestTools.Common
Assembly:  Microsoft.VisualStudio.QualityTools.Common (in Microsoft.VisualStudio.QualityTools.Common.dll)

Syntax

'Declaration
Public Sub SetTestEnvironment ( _
    controllerName As String, _
    testEnvironmentName As String _
)
public void SetTestEnvironment(
    string controllerName,
    string testEnvironmentName
)
public:
void SetTestEnvironment(
    String^ controllerName, 
    String^ testEnvironmentName
)
member SetTestEnvironment : 
        controllerName:string * 
        testEnvironmentName:string -> unit
public function SetTestEnvironment(
    controllerName : String, 
    testEnvironmentName : String
)

Parameters

  • controllerName
    Type: String

    Name of the controller that hosts the test environment. If this is null, the tests are run locally.

  • testEnvironmentName
    Type: String

    Name of the test environment to use. Null or empty removes any ties to any test environment from the test settings.

Exceptions

Exception Condition
Common_TestSettings_SetTestEnvironment_ControllerNullEnvironmentNotNull

controllerName is null or empty but testEnvironmentName is not.

.NET Framework Security

See Also

Reference

TestRunConfiguration Class

Microsoft.VisualStudio.TestTools.Common Namespace