292 Views
First part of two showing examples from real life where TaskCompletionSource has proven useful. In this part: mocking Tasks for testing.
2 comments
dpeterson
1/24/2012 8:42:22 AM
Interesting, so the TaskCompletionSource is used to mock behavior that you don't want to test, correct?
fredrikmork
1/24/2012 8:48:20 AM
Yes, that is correct. Anything returning a Task can be rather easily mocked using this approach.