I'm trying to run asynchronous test methods with .NET 4.0 BCL Async and MsTest.
It seems that this setup is not able to deal with [TestMethod] async Task TestSth() due to a missing entry in the test case explorer. After changing the signature to async void, I can run the the test case but with the wrong outcome (no errors will be reported at all).
I have seen an attemt at Running Async Task unit tests with TFS 2010 but I think there should be a prettier way to tackle the problem.
Any suggestions?
You can only use the async
keyword with an MSTest-referencing class library targeting .NET 4.5.
If you can't use .NET 4.5 for whatever reason, then you'll just have to live with waiting on the tasks manually.
And even if the production code (i.e. the code under test) can't use .NET 4.5, why can't the test project do so? If you already have VS 2012+ available to you, then .NET 4.5 will be installed on your development machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With