Microsoft KB Archive/919649

= You cannot use inheritance in unit testing in Visual Studio Team System Test Edition and Visual Studio Team System Developer Edition =

Article ID: 919649

Article Last Modified on 7/31/2006

-

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:

http://msdn2.microsoft.com/en-us/library/ms182516.aspx

http://msdn2.microsoft.com/en-us/library/ms173149.aspx

Keywords: kbinfo kbtshoot kbprb KB919649

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.