title: FluentAssertions ShouldNotThrow is not recognised for an async method/Func
body: <p>I am trying to check an async method throws concrete exception.</p>
  
  <p>For that I am using MSTEST and FluentAssertions 2.0.1.</p>
  
  <p>I have checked this <a href="http://fluentassertions.codeplex.com/workitem/12148" rel="noreferrer">Discussion on Codeplex</a> and to see how it works with async-exception methods this another one link about <a href="https://fluentassertions.codeplex.com/SourceControl/changeset/view/c1bc29ff258e622fac71730955bd1ea066880874#Main/FluentAssertions.Net45.Specs/AsyncFunctionExceptionAssertionSpecs.cs" rel="noreferrer">FluentAssertions async tests</a>: </p>
  
  <p>After a while trying to work with my 'production' code I have switched off to the Fluentassertions fake aync class and my resulting code is like this (put this code inside a <code>[TestClass]</code>:</p>
  
  <pre><code>[TestMethod]
  public void TestThrowFromAsyncMethod()
  {
      var asyncObject = new AsyncClass();
      Action action = () =&gt;
      {
          Func&lt;Task&gt; asyncFunction = async () =&gt;
          {
              await asyncObject.ThrowAsync&lt;ArgumentException&gt;();
          };
          asyncFunction.ShouldNotThrow();
      };
  }
  
  
  internal class AsyncClass
  {
      public async Task ThrowAsync&lt;TException&gt;()
          where TException : Exception, new()
      {
          await Task.Factory.StartNew(() =&gt;
          {
              throw new TException();
          });
      }
  
      public async Task SucceedAsync()
      {
          await Task.FromResult(0);
      }
  }
  </code></pre>
  
  <p>The problem is that <code>ShouldNotThrow</code> is not valid:</p>
  
  <blockquote>
    <p>ShouldNotThrow method is not recognised by the code. If I try to
    compile, it gives me this error:
    'System.Func' does not contain a
    definition for 'ShouldNotThrow' and the best extension method overload
    'FluentAssertions.AssertionExtensions.ShouldNotThrow(System.Action,
    string, params object[])' has some invalid arguments</p>
  </blockquote>
  
  <p>Thanks.</p>
  
  <hr>
  
  <h1>SOLUTION</h1>
  
  <p>2.0.1 FA version doesn't support this <code>ShouldNotThrow</code> functionality and it will be included in the next reléase 2.1 (near next week). </p>
  
  <p>Note: ShouldThrow is already supported in 2.0.1 versión.</p>