tmauldin / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Assert failures in Assert.DoesNotThrow make output noisy #769

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If code called within an Assert.DoesNotThrow contains one or more Asserts, and 
any of those assertions fail, the output (at least as displayed by Gallio 
Icarus) reports two errors: both the primary failure and the DoesNotThrow.

For example, «Assert.DoesNotThrow(() => Assert.IsTrue(false));» reports that 
both assertions failed, but I only expect the IsTrue to fail.

This makes diagnosing the actual issue more difficult than necessary, because I 
have to figure out that the DoesNotThrow assertion will be fixed automatically 
once I fix the IsTrue assertion. Even after I figure that out, I still have to 
put effort into inspecting each error and determining which ones are really my 
fault which ones are generated by the framework.

This is with Gallio Icarus version 3.2 build 601 (yes, it calls itself 601, 
even though the installer says 603) and MBUnit version 3.2.0.0, both installed 
from "Gallio v3.2 RTM build 603 - x86 installer".

Original issue reported on code.google.com by dales...@gmail.com on 14 Nov 2010 at 4:19

GoogleCodeExporter commented 9 years ago
An failing assertion actually throws a AssertionFailureException which explains 
why DoesNotThrow also fails. But this is something we could improve. 
DoesNoThrow should actually simply ignore AssertionFailureExceptions because 
they will be reported later as a failing assertion anyway.

Going to fix that soon; otherwise you might submit a patch if you want (see if 
the status of the issue is not "Started" yet)

Thank you for reporting that,
Yann.

Original comment by Yann.Tre...@gmail.com on 15 Nov 2010 at 7:12

GoogleCodeExporter commented 9 years ago

Original comment by Yann.Tre...@gmail.com on 18 Nov 2010 at 10:31

GoogleCodeExporter commented 9 years ago
Fixed in v3.3 trunk and v3.2 branch.
Will be part of the v3.2.1 release.

Original comment by Yann.Tre...@gmail.com on 18 Nov 2010 at 10:41

GoogleCodeExporter commented 9 years ago

Original comment by Yann.Tre...@gmail.com on 5 Dec 2010 at 11:33