Issue #1: Inheritance of Test Classes is not supported when the base class is in a different assembly

 

Workaround
Place all the classes which will use inheritance in the same test project so that they end up in the same assembly.

 



Issue #2: No inheritance for Test Class Attributes [ClassInitialize] and [ClassCleanup]

 

Instructions 

Add ClassInitialize and ClassCleanup methods to the derived class, and call the base classes implementation.

 

Here's some sample code.  In the base class, you have:

 

[TestClass]

public class MyBase

{

    [ClassInitialize]

    public static void BaseClassInit(TestContext testContext)

    {

        //do something

    }

}

From derived class:

 

[TestClass]

public class MyDerived

{

    [ClassInitialize]

    public static void DerivedClassInit(TestContext testContext)

    {

        MyBase.BaseClassInit(testContext);

    }

}

 

Hope this is helpful,

David Gorena Elizondo

[MSFT] VSTT