How to write unit test cases for async methods?
问题 I would like to write a unit test case by mocking the dependencies. The overall flow is as follows. We have a WorklistLoader which has an async method LoadWorklistItemsAsync() . To accomplish this task WorklistLoader is dependent on lower layer API(which i want to mock) QueryManager.StartQueryTask() . StartQueryTask() is also a async method which queries the file system and raises the ProgressChanged() at regular intervals and then at the end raises the CompletedEvent . StartQueryTask()