I have a base class for my tests, which is composed as follows:
[TestClass] public abstract class MyBaseTest { protected static string myField = ""; [ClassInitialize] public static void ClassInitialize(TestContext context) {
Now I'm trying to create a new test that inherits from the database, with the following signature:
[TestClass] public class MyTest : MyBaseTest { [TestMethod] public void BaseMethod_ShouldHave_FieldInitialized() { Assert.IsTrue(myField == "new value"); } }
ClassInitialize never called by child tests ... What is the real and correct way to use test initialization with inheritance on MsTest?
c # mstest
Raffaeu Apr 11 '13 at 8:54 2013-04-11 08:54
source share