Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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: StringName of the controller that hosts the test environment. If this is null, the tests are run locally.
testEnvironmentName
Type: StringName 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.