I want to unit test a method that I have that performs and async operation:
Task.Factory.StartNew(() => { // method to test and return v
Try something like this...
object result = null; Task t = Task.Factory.StartNew(() => result = LongRunningThing()); Task.Factory.ContinueWhenAll(new Task[] { t }, () => { Debug.Assert(result != null); });