Reputation: 2336
Is it possible to use Assert.DoesNotThrow
with a particular exception type?
For example how do I verify that a method call is not throwing NullReferenceExceptions
specifically but it may throw NotSupportedException
which I don't care about. ?
Upvotes: 2
Views: 4229
Reputation: 1361
There's a pattern null checking in xUnit.
var ex = Record.Exception(...);
Assert.Null(ex);
It's bit late; however, hope it helps you :).
Upvotes: 8