TaskCompletionSource in real life (part 1 of 2)

added by fredrikmork
1/24/2012 8:43:40 AM

2 Kicks, 213 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.