The type of host identifies the test as being run outside the current environment. When a test is run in a different environment, it might also run in a different process. The following example shows the test being run in the ASP.NET Development Server address space. This is designated by the AspNetDevelopmentServerHostAttribute. You do this by using a host adapter. Visual Studio 2005 includes one host adapter called ASP.NET. This is used for ASP.NET unit testing. Customers can create their own host adapters through Visual Studio Industry Partner (VSIP) program.
Note: |
|---|
The
Visual Studio SDK contains a sample application called "VSIdeHostAdapter." As an example host adapter, it demonstrates how to create a host adapter that runs tests inside a Visual Studio process.
|
The HostTypeAttribute attribute can be specified on a test method. There can be only a single instance of this attribute on a method.
For more information about how to use attributes, see Extending Metadata Using Attributes.