✅ Test Explorer Skips Async Tests
When I change the test to public async void TestMethod1, the function is skipped by Test Explorer (even when there isn't actually an await function and it's just a Console.WriteLine). When it is switched back to not async (public void TestMethod1) the test is run and successful.
I need to test some async functions. How can I do this?
6 Replies
Have your tests return Task, not void
It's not that it skips them: they start, and the method immediately returns and the test framework has no way to know they're still running
Thanks for your help! I also just figured this out before I checked discord again. RIP 30 minutes
No worries, I only just responded anyway
Make sure you $close the thread if that's it
If you have no further questions, please use /close to mark the forum thread as answered
Thanks!
$close
If you have no further questions, please use /close to mark the forum thread as answered