title: Ignoring Exceptions in xUnit.net
body: <p>I have some cases where I don't care what exception is thrown (as long as some exception is thrown). Unfortunately,</p>
  
  <pre><code>Assert.Throws&lt;Exception&gt;(someDelegate);
  </code></pre>
  
  <p>doesn't pass unless exactly an instance of <code>Exception</code> (so not an instance of a derived class) is thrown. I know I can obtain the behavior I want with</p>
  
  <pre><code>Exception exception = Record.Exception(someDelegate);
  Assert.NotNull(exception);
  </code></pre>
  
  <p>but it doesn't read right. Am I missing something in xUnit that has the behavior I want? Here are two tests that indicate what I mean:</p>
  
  <pre><code>[Fact]
  public void Throws_exception_and_passes() {
      Exception exception = Record.Exception(
          () =&gt; { throw new InvalidOperationException(); }
      );
      Assert.NotNull(exception);
  }
  
  [Fact]
  public void Throws_exception_and_fails() {
      Assert.Throws&lt;Exception&gt;(
          () =&gt; { throw new InvalidOperationException(); }
      );
  }
  </code></pre>