title: NSubstitute - mock throwing an exception in method returning Task
body: <p>Using <a href="http://nsubstitute.github.io" rel="noreferrer">NSubstitute</a>, how do you mock an exception being thrown in a method returning a Task?</p>
  
  <p>Let's say our method signature looks something like this:</p>
  
  <pre><code>Task&lt;List&lt;object&gt;&gt; GetAllAsync();
  </code></pre>
  
  <p>Here's how NSubstitute docs say to mock throwing exceptions for non-void return types. But this doesn't compile :(</p>
  
  <pre><code>myService.GetAllAsync().Returns(x =&gt; { throw new Exception(); });
  </code></pre>
  
  <p>So how do you accomplish this?</p>