The test fails because the thrown exception is not implemented and prevents the test from executing until completion.
Use Assert.Throws<>to approve an excluded exception
[Test]
public void WindowTest() {
Assert.That(ThrowsSomething("dave"), Is.EqualTo(-1));
Assert.Throws<ArgumentNullException>(() => ThrowsSomething(null));
}
or use a delegate so that the exception can be caught and handled by the statement.
Assert.That(() => ThrowsSomething(null), Throws.Exception.TypeOf<ArgumentNullException>());
Nkosi source
share