We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I could not find any examples of using the callback to get the exception message. It would be very helpful to include a few examples of this.
The text was updated successfully, but these errors were encountered:
@jwvanderbeck if you want to test exception message you could try something like
Assert.Throws(Is.TypeOf<InvalidOperationException>() .And.Message.EqualTo("I am the test exception"), () => fixture.TestThatThrowsException());
or
var ex = Assert.Throws<InvalidOperationException>(() => fixture.TestThatThrowsException()); Assert.AreEqual("I am the test exception", ex.Message);
Sorry, something went wrong.
@jwvanderbeck I know this issue is a bit old, but please let me know if the example on our Assert.Throws docs is clear enough; if not, feel free to file an issue / PR over there too: https://docs.nunit.org/articles/nunit/writing-tests/assertions/classic-assertions/Assert.Throws.html
Assert.Throws
No branches or pull requests
Hi,
I could not find any examples of using the callback to get the exception message. It would be very helpful to include a few examples of this.
The text was updated successfully, but these errors were encountered: