Just wondering, if anyone thought like this:
This is incorrect design to have async call within TestInitialize, as TestInitialize has to happen befo
What you want to do is to use .Result or .Wait() to synchronously block the TestInitialize decorated method. You can do the following:
.Result
.Wait()
TestInitialize
private int val = 0; [TestInitialize] public void TestMehod1() { Task result = await LongRunningMethod(); result.Wait(); val = 10; } [TestMethod] public void TestMehod2() { Assert.AreEqual(10, val); }