You cannot use inheritance in unit testing in Visual Studio Team System Test Edition and Visual Studio Team System Developer Edition (919649)



The information in this article applies to:

  • Microsoft Visual Studio 2005 Team System Developer Edition
  • Microsoft Visual Studio 2005 Team System Test Edition

INTRODUCTION

In Microsoft Visual Studio 2005 Team System Test Edition and in Microsoft Visual Studio 2005 Team System Developer Edition, inheritance is not supported in unit testing.

MORE INFORMATION

In Microsoft Visual Studio 2005 Team System Test Edition and in Microsoft Visual Studio 2005 Team System Developer Edition, you can use unit tests to test the methods and the properties of a class by directly calling a method and then passing parameters to the method. Additionally, when you create unit tests, the test methods are compiled into a single test class.

You can create a test class that uses inheritance, but test methods in base classes are not considered test methods in derived classes. In other words, although you can derive a test class from a base test class, you cannot successfully run test methods in the derived class.

Methods that you write within your derived class and that you mark with the TestMethod attribute appear in the test windows. You can run these methods in the Visual Studio IDE and from the command line.

For more information, visit the following Microsoft Developer Network (MSDN) Web sites:

Modification Type:MajorLast Reviewed:7/31/2006
Keywords:kbinfo kbtshoot kbprb KB919649 kbAudITPRO kbAudDeveloper