Not sure this is a known issue. I’m using VS2012 RC (Ultimate), and Win8 Release Preview. I have created a Unit Test Library (metro style app), and wrote a Unit Test, which include async/await keywords. However when I compile the Unit Test project, Unit Test Explorer does not show up the Test I wrote. If I exclude the async/await keywords, then the Unit Test Explorer shows up in the Test I just wrote. Has anyone come across with this before, or is it just me?
[TestClass]
public class UnitTest1
{
[TestMethod]
public async void SomeAsyncTest()
{
var result = await StorageFile.GetFileFromPathAsync("some file path");
}
}
Unit test methods that are
asynchave to returnTask, notvoid.That’s because
async voidmethods are hard to track: there is no easy way for the unit testing library to find out that the test completed. (It’s hard, but I think it’s not impossible. You could do this by using a customSynchronizationContext.)