I would like to test a method that I am expecting to block in a specific situation.
I tried a combination of the TimeoutAttribute
and ExpectedExceptionAttribute
:
[Test]
[Timeout(50), ExpectedException(typeof(ThreadAbortException))]
public void BlockingCallShouldBlock()
{
this.SomeBlockingCall();
}
Unfortunately this does not work as the ThreadAbortException
I was reading about here seems to get caught by NUnit itself.
Is there a way to expect timeouts (with NUnit)?