Export (0) Print
Expand All

Creating and Using Host Adapters

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

A host is a test execution environment, an application process in which test code is executed, and in the case of unit tests, production code as well. Team Edition for Testers provides a default test host, VSTestHost.exe. By default, tests are executed in the VSTestHost.exe process.

There are limitations on running tests using the default test host. For example, when you run unit tests in VSTestHost.exe, the production code is not executed in its real execution environment.

Sometimes, and more importantly, production code may not work when not running in its real execution environment. A typical example is that of unit tests for ASP.NET Web applications. The ASP.NET application code may need to access the ASP.NET context, which makes objects such as the HttpSessionState, HttpApplication, and HttpRequest available to the application code.

Also, page-specific objects must be initialized properly so that application code that works with them can run without throwing exceptions. VSTestHost.exe cannot provide the ASP.NET context nor these runtime objects. Team Edition for Testers overcomes this problem by using an ASP.NET host adapter. It lets you run unit tests for ASP.NET Web applications in the IIS process or in an ASP.NET Development Server process.

There are other situations in which you want to execute tests in hosts other than the default test host. Team Edition for Testers provides the means by which you can develop your own host adapters to achieve that.

The Help topics in this section describe how to build and install such a host adapter, and to use it when you run tests.

In This Section

Overview of Host Adapters

Describes the basics of running tests in various runtime environments and why you might need to create a host adapter to support a new environment or platform.

Running Tests in Application Hosts

Describes how to run tests in the runtime environment created by the test host that you created.

How to: Create a Host Adapter

Describes how to implement one interface for running tests and another interface for adding a page to the test run configuration editor. You build these implementations into one or two DLLs.

How to: Install a Host Adapter

Describes how to install and register your host adapter DLLs on the computers where they are needed.

How to: Specify Tests to Run in a Host Adapter

Describes how to specify a host adapter for running tests in either of two ways, by using the HostType attribute and by specifying the host in the test run configuration editor.

How to: Obtain the Host Adapter Sample

Describes how to download and install the Visual Studio SDK. A project within the Visual Studio SDK contains sample code for a host adapter.

Reference

Related Sections

Creating Custom Test Types in Visual Studio Team System

Discusses how to develop new test types that integrate with Visual Studio Team System.

Community Additions

ADD
Show:
© 2014 Microsoft