Global test initialize method for MSTest

Create a public static method, decorated with the AssemblyInitialize attribute. The test framework will call this Setup method once per test run:

[AssemblyInitialize]
public static void MyTestInitialize(TestContext testContext)
{}

For TearDown its:

[AssemblyCleanup]
public static void TearDown() 
{}

EDIT:

Another very important detail: the class to which this method belongs must be decorated with [TestClass]. Otherwise, the initialization method will not run.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)