title: NUnit expected exceptions
body: <p>I've got a set of test cases, some of which are expected to throw exceptions. Because of this, I have have set the attributes for these tests to expect exceptions like so:</p>
  
  <pre><code>[ExpectedException("System.NullReferenceException")]
  </code></pre>
  
  <p>When I run my tests locally all is good. However when I move my tests over to the CI server running TeamCity, all my tests that have expected exceptions fail. This is a known bug.</p>
  
  <p>I am aware that there is also the <code>Assert.Throws&lt;&gt;</code> and <code>Assert.Throws</code> methods that NUnit offers. </p>
  
  <p>My question is how can I make use of these instead of the attribute I'm currently using?</p>
  
  <p>I've had a look around StackOverflow and tried a few things none of which seem to work for me. </p>
  
  <p>Is there a simple 1 line solution to using this?</p>