title: Async callback on mocked object not awaiting
body: <p>I am attempting to mock a complicated situation for unit testing:</p>
  
  <pre><code>_mockController = new Mock&lt;IController&gt;();
  _mockController.Setup(tc =&gt; tc.Interrupt(It.IsAny&lt;Func&lt;Task&gt;&gt;()))
      .Callback&lt;Func&lt;Task&gt;&gt;(async f =&gt; await f.Invoke());
  </code></pre>
  
  <p>Where <code>IController</code> has a void method <code>Interrupt(Func&lt;Task&gt;&gt; f)</code>, which queues some work to be done.</p>
  
  <p>My objects under test do call <code>Interrupt()</code>, and I can verify the call like so:</p>
  
  <pre><code>_mockController.Verify(tc =&gt; tc.Interrupt(It.IsAny&lt;Func&lt;Task&gt;&gt;()), Times.Once);
  </code></pre>
  
  <p>...but when the argument <code>Func&lt;Task&gt;</code> is invoked in the callback, the <code>await</code> keyword is not respected in the <code>Task</code>: the execution of the test continues before the <code>Task</code> finishes (despite the <code>await</code> in the callback).  One symptom of this is that adding an <code>await Task.Delay(1000)</code> in the <code>Interrupt()</code> <code>Task</code> argument turns a passing test into a failing test.</p>
  
  <p>Is this behavior due to a nuance of how threads or <code>Task</code>s are handled during test?  Or a limitation of Moq?  My test methods have this signature:</p>
  
  <pre><code>[Test]
  public async Task Test_Name()
  {
  }
  </code></pre>