title: How to properly test Exceptions with FsUnit
body: <p>I'm trying to figure out how to properly test exceptions with FsUnit. Official documentation states, that to test for exceptions I have to right something like this:</p>
  
  <pre><code>(fun () -&gt; failwith "BOOM!" |&gt; ignore) |&gt; should throw typeof&lt;System.Exception&gt;
  </code></pre>
  
  <p>But, if I don't mark my test method with <code>[&lt;ExpectedException&gt;]</code> attribute it will always fail. Sounds reasonable because if we want to test for exceptions we have to add such attribute in C# + NUnit. </p>
  
  <p>But, as long as I've added this attribute it doesn't matter what kind of exception I'm trying to throw, it will be always handled.</p>
  
  <p>Some snippets:
  My LogicModule.fs</p>
  
  <pre><code>exception EmptyStringException of string
  
  let getNumber str =
      if str = "" then raise (EmptyStringException("Can not extract number from empty string"))
      else int str
  </code></pre>
  
  <p>My LogicModuleTest.fs</p>
  
  <pre><code>[&lt;Test&gt;]
  [&lt;ExpectedException&gt;]
  let``check exception``()=
      (getNumber "") |&gt; should throw typeof&lt;LogicModule.EmptyStringException&gt;
  </code></pre>