Re: NUnit 2.5: What's In It Now

"Kelly Anderson" <[email protected]> Thu, 10 Apr 2008 18:26:24 -0600
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <[email protected]>
On Thu, Apr 10, 2008 at 3:10 PM, Charlie Poole
<[email protected]> wrote:
> Hi Gary,
>
> For example, you write
>    Assert.That( 2 + 2 , Is.EqualTo( 5) );
> I'd like the test result that says "Expected: 4 But was: 5" to go back to
> NUnit
> without throwing an AssertionException.
>
> Why you ask?
>
> Because then, if you wrote
>   Assert.That( 2+2, Is.EqualTo( 4) );
> I could give NUnit that successful result, and continue with the test.
>
> Reporting of successful asserts is a long-standing request and reporting
> failure via an exception seems wrong to me, since failures are expected
> in a test framework.
>
> That would not change how other exceptions are reported, however.
>
> Any ideas?

Assert could be implemented such that if it were successful, it could
append the successful assertion to an output reporting mechanism,
while still throwing exceptions for failure. You already have to catch
other exceptions anyway as you say.

I think it is very bad to continue execution after an Assertion has
failed. That changes what assert has meant for thirty plus years in
the C/C++/C# world. That would be like putting a game boy console in
place of the steering wheel, accelerator and breaks of a car IMHO.

-Kelly

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone