title: how do you specify that an NUnit test should fail?
body: <p>Is there a way to specify that you want an NUnit test to fail, meaning that a fail should be reported as a pass and a pass should be reported as a fail? This would be useful when testing your own NUnit extensions. Here is an example of something I would like to be able to do:</p>
  
  <pre><code>[Test]
  [ExpectFail]
  public void TypeOf_fail() {
      string str = "abc";
      str.Should().Be.TypeOf&lt;int&gt;();
  }
  </code></pre>
  
  <p>This does not compile because [ExpectFail] is an imaginary attribute to illustrate what I want to do, but the code inside the method works fine. This problem is specific to testing an NUnit extension in that you can normally just easily write your tests to pass, not fail. In this case you need prove that it is possible to write a failing test using the NUnit extension that you are testing.</p>