«Template Method»s [GoF] and Unit Testing

I’m trying to implement a ?Template Method in an abstract base class. I’d like to mark the ?Template Method with the [TestMethod] attribute, and have all the sub-classes run the test method.

However, the Test Manager says that methods of an abstract class can’t be marked as test methods.

My current workaround is having a method in the sub-classes (marked as [TestMethod]) call the ?Template Method of the base class.

Regards,

Martin Rosn-Lidholm

[1834 byte] By [totte500] at [2008-2-22]
# 1
Hi.

This is not something that we support. See: http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=16237 for more details.

dhoptonMSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Performance Tools (Profiler)...

Visual Studio Team System

Site Classified