Share via


Implementing a Custom Test Type - Part 1

Introduction

This and the next few blog posts will be focussed on implementing a custom test type for Visual Studio 2008. We have an internal tool that our team uses for testing quite extensively and which pre-dates the testing capabilities introduced in Visual Studio. Consequently, we have a considerable investment in our test code. However, given the broad range of other features that the Visual Studio test tools provide, we obviously do not want to lose out on harnessing them. For example, one scenario would be to combine our tests into load tests and execute them VS. Another scenario would be to use TFS to execute our tests every few product builds. Although the latter can be done with a custom MSBuild task, it would be great for other integration efforts if our tests were treated like a native VS test type.

Getting Started

The first thing that the test type extensibility documentation fails to mention is that a custom test type is implemented in a VS Integration Package. Consequently, although you might be tempted to write a class library containing your implementation of the various interfaces detailed here

https://msdn.microsoft.com/en-us/library/bb166343.aspx#TestElementClass

and follow the instructions given at the end for registering your test type. However, the sample provided in the VS SDK at

%HOMEDRIVE%:\%PROGRAMFILESDIR%\Microsoft Visual Studio 2008 SDK\VisualStudioTeamSystemIntegration\Test Tool Extensibility\MyTest 

makes it quite evident that you need a VSIP. So, we will start by creating one.

Comments