Background and motivation
Sometimes you want to ensure a particular exception is thrown, but where the message does not contain a particular wildcard phrase.
API Proposal
Affects ExceptionAssertions and ExceptionAssertionsExtensions
API Usage
Instead of
act.Should().Throw<XunitException>().WithMessage("*existingProperty*wrongvalue*")
.Which.Message.Should().NotContain("missingProperty");
it would allow
act.Should().Throw<XunitException>()
.WithMessage("*existingProperty*wrongvalue*")
.WithoutMessage("*missingProperty*");
Alternative Designs
No response
Risks
No response
Are you willing to help with a proof-of-concept (as PR in that or a separate repo) first and as pull-request later on?
No