MSTEST - async Testinitialize guarantee test fail
问题 Just wondering, if anyone thought like this: This is incorrect design to have async call within TestInitialize, as TestInitialize has to happen before any TestMethod. Can this be correct approach in any way to have async TestInitialize as well? private int val = 0; [TestInitialize] public async Task TestMehod1() { var result = await LongRunningMethod(); val = 10; } [TestMethod] public void TestMehod2() { Assert.AreEqual(10, val); } any thought? 回答1: Probably the cleanest way to do this is to