特定の状況でブロックすると予想されるメソッドをテストしたいと思います。
TimeoutAttributeとの組み合わせを試しましたExpectedExceptionAttribute:
[Test]
[Timeout(50), ExpectedException(typeof(ThreadAbortException))]
public void BlockingCallShouldBlock()
{
this.SomeBlockingCall();
}
残念ながら、ここThreadAbortExceptionで読んでいたのは NUnit 自体に引っかかるように見えるため、これは機能しません。
(NUnit を使用して) タイムアウトを期待する方法はありますか?