Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AssemblyInitialize in derived class

Tags:

c#

mstest

I have a abstract base test class that has an AssemblyInitialize attribute applied to a method. But it will be never executed... The abstract base test class is in another assembly because it is for a generic extension. Any ideas how to solve this?

The code

[TestClass]
public abstract BaseTestClass
{    
   [AssemblyInitialize]
   public static void AssemblyInit(TestContext context)
   {
      //DoDomething
   }
}

Thanks in advance

like image 899
mrtentje Avatar asked Apr 03 '13 08:04

mrtentje


1 Answers

I had the same problem when I didn't mark the test base class with the [TestClass] attribute.

like image 147
astef Avatar answered Sep 29 '22 13:09

astef