TaskCompletionSource in real life (part 1 of 2)(softwareblog.alcedo.com)

submitted by fredrikmorkfredrikmork(142) 29 days, 22 hours ago

First part of two showing examples from real life where TaskCompletionSource has proven useful. In this part: mocking Tasks for testing.

2 comments |category: |Views: 118

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by dpetersondpeterson(3582) 29 days, 15 hours ago 0

Interesting, so the TaskCompletionSource is used to mock behavior that you don't want to test, correct?

Reply

posted by fredrikmorkfredrikmork(142) 29 days, 15 hours ago 0

Yes, that is correct. Anything returning a Task can be rather easily mocked using this approach.

Reply

information Login or create an account to comment on this story