← Back to team overview

nunit-core team mailing list archive

[Bug 957899] Re: Feature: Assert.DoesNotThrow() needs exception details

 

It turns out that the fix in 2.6 is not even as extensive as the release
notes imply:

"When Assert.Throws() fails due to an exception of the wrong Type being
thrown, the error message now includes the Message and Stack Trace from
the exception. "

Actually, this only applies to the Assert.Throws(Type, ...) overloads
and should be made clear in the documentation.

The release notes are correct in excluding Assert.DoesNotThrow as well as the constraint syntax:
   Assert.That(<code>, Throws.Exception....);
   Assert.That(<code>, Throws.Nothing);
   ...

I'll try to add this feature wherever the wrong type of exception is
detected. It doesn't seem to make sense when testing for a specific
value of an exception property, since the message already gives the
needed info.


** Changed in: nunitv2
       Status: New => Triaged

** Changed in: nunitv2
   Importance: Undecided => High

** Changed in: nunitv2
     Assignee: (unassigned) => Charlie Poole (charlie.poole)

** Changed in: nunitv2
    Milestone: None => 2.6.1

-- 
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:
  Triaged

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