nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #02647
[Bug 957899] Re: Feature: Assert.DoesNotThrow() needs exception details
I think ExpectedException is used for Assert.Throws(), not
Assert.DoesNotThrow() isn't it?
Knowing the type of exception alone, though, often isn't enough to
diagnose an unexpected failure. You need details. Without them you
have to modify the test code to catch the Exception - which, in turn,
opens it up to failure.
Currently, DoesNotThrow() prints "Unexpected Exception: {0}",
ex.GetType(). Instead, it could just convert the exception to a string
and provide complete details.
Throws() would probably also benefit from this.
--
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/957899
Title:
Feature: Assert.DoesNotThrow() needs exception details
Status in NUnit V2 Test Framework:
New
Bug description:
NUnit 2.5.10 11092 (Windows)
When Assert.DoesNotThrow() actually does throw an Exception, the
Errors and Failures window of the GUI does not show any details about
the exception. Rather, it just shows the provided text parameter and:
Unexpected exception: NUnit.Framework.AssertionException
It would be handy if the Assert would also show details about the
Exception being thrown. Otherwise, test code has to be changed to
find out what went wrong.
Thanks.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nunitv2/+bug/957899/+subscriptions
References