Welcome to MSDN Blogs Sign in | Join | Help

Known-Issues and workarounds for Orcas (Beta1): Inheritance

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

Published Tuesday, May 01, 2007 11:31 PM by VSTS Quality Tools

Comments

# Some known-issues of quality tools in Orcas beta1

雖然 Orcas beta1 並沒有中文版, 英文版在這個月初已經可以 download 了, 我相信應該已經開始有人 playing this beta, 所以分享一些 quality tools teams

Monday, May 28, 2007 12:28 AM by Eric Hu's Weblog

# Some known-issues of quality tools in Orcas beta1

雖然 Orcas beta1 並沒有中文版, 英文版在這個月初已經可以 download 了, 我相信應該已經開始有人 playing this beta, 所以分享一些 quality tools teams

Friday, July 20, 2007 12:16 AM by 外部部落格
Anonymous comments are disabled
 
Page view tracker