Click here to Skip to main content
15,893,622 members
Articles / General Programming / Threads

Mocking Task.Factory.StartNew

Rate me:
Please Sign up or sign in to vote.
4.95/5 (7 votes)
6 Jan 2014CPOL3 min read 27.9K   179   8  
Task.Factory.StartNew can be very useful for executing a method on another thread where you don't care about the result, but it can also make the host method hard to test. This tip describes how to inject Task.Factory and mock it for testing.

Views

Daily Counts

Downloads

Weekly Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions