Assert.Throws() hides details of inner AssertionException
Bug #800089 reported by
Sergey S.
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Framework |
Fix Released
|
Medium
|
Charlie Poole | ||
NUnit V2 |
Fix Released
|
Medium
|
Charlie Poole |
Bug Description
NUnit 2.5.9.10348
If AssertionException happens in a delegate provided to Assert.Throws() the diagnostic message does display no details making it hard to know which of asserts failed:
Test 'Test.Issue' failed:
Expected: <System.
But was: <NUnit.
instead it would be good to display the assert message if AssertionException was thrown like:
Test 'Test.Issue' failed:
Expected: <System.
But was: <NUnit.
plus the inner stack trace. Please see the test attached.
Changed in nunitv2: | |
milestone: | none → 2.6.0 |
Changed in nunitv2: | |
importance: | Low → Medium |
assignee: | nobody → Charlie Poole (charlie.poole) |
Changed in nunitv2: | |
status: | Triaged → In Progress |
Changed in nunitv2: | |
status: | In Progress → Fix Committed |
Changed in nunit-3.0: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in nunit-3.0: | |
milestone: | none → 2.9.6 |
Changed in nunitv2: | |
status: | Fix Committed → Fix Released |
Changed in nunit-3.0: | |
assignee: | nobody → Charlie Poole (charlie.poole) |
Changed in nunit-3.0: | |
status: | Triaged → In Progress |
Changed in nunit-3.0: | |
status: | In Progress → Fix Committed |
Changed in nunit-3.0: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Normally, one would expect Assert.Throws to be used with one of the methods under test rather than with a test method. Nevertheless, it seems useful to give more info about the exception that was actually thrown.