Testing Strategies Involving Async Functions
Some things to keep in mind when writing units tests for code that use async methods: You’re not trying to test the framework’s “awaitability” and you’re not trying to test framework methods that are “awaitable”. You want to test your code in certain isolation contexts. One context, of course, is independent of asynchronicity–do individual units of code that don’t depend on asynchronous invocation “work”… e.g. “Task<string> MyMethodAsync()”, you want to have a unit test that make sure this method does what it’s supposed to do (one being it returns a “valid” Task<string> object, the other being that individual side-effects occur, … Continue reading Testing Strategies Involving Async Functions