I'm using FluentAssertions
.
For a sync test, I can write this:
action.Should().Throw<ArgumentNullException>().And.ParamName.Should().Be("foo");
For an async test, I do this:
await action.Should().ThrowAsync<ArgumentNullException>();
Is there a convenience method to also assert ParamName
, or must I do it manually by wrapping in a try-catch?