IHostedTest::HostType Property
The IHostedTest.HostType string identifies a host. Testers can use this string in the HostType attribute on a custom test to specify a host in which to run that test.
Assembly: Microsoft.VisualStudio.QualityTools.Common (in Microsoft.VisualStudio.QualityTools.Common.dll)
For unit tests, the HostType attribute in which you can use this string comes from the Unit Testing Framework.
The TestElement class implements the IHostedTest interface. For test types that do not derive from TestElement, the developer of the test type must enable test users to specify the host type to use when they run tests. As described in How to: Specify Tests to Run in a Host Adapter, you can do this either by setting properties in the Properties window, by using the HostType attribute (for unit tests), or by supporting the test run configuration editor.
Legacy Code Example
For the complete code of the following example, see the MyTest.cs file in the test extensibility sample in the Visual Studio SDK. You do not have to include the following if your custom test type derives from TestElement.
private string m_hostType;
string IHostedTest.HostType
{
get
{
return m_hostType;
}
set
{
m_hostType = value;
}
}