Re: How do I debug break in case of assertion failure?

"Igor Gatis" <[email protected]> Thu, 7 Aug 2008 12:08:10 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
Hi Charlie,

I believe people is just used to the behavior of
System.Diagnostics.Debug.Assert(). Besides, while developing tests, it helps
a lot to have a automatic break mechanism; in case of failure, the test
developer can easily check values and verify what is going on. With such
mechanism in place, the following steps are collapsed in a single one:

1) Run tests for the first time
2) Verify where exactly the failure was
3) Open a debugger
4) Place a break point
5) Run tests again

While using NUnit, I was expecting to find something like:

Assert.BreakOnFailure = true;

It's default value would be false. Once I'm done with development of the
tests, I could just remove or comment out this line.

IMHO, In the way you're saying, you're pushing NUnit users to write tests in
a specific way, which is fine. That the adoption a little less attractive
though.

Thanks,
-Igor

On Wed, Aug 6, 2008 at 7:57 PM, Charlie Poole
<[email protected]>wrote:

>  No, it's an entirely different mechanism.
>
> Going into debug every time you have a failure sounds like a misuse of the
> test framework to me. If your tests are sufficiently small in scope, test
> only
> one thing and are well-named, you will almost always know where the
> problem lies when you get a failure. You should see your need for using
> the debugger decline.
>
> Charlie
>
>  ------------------------------
> *From:* Igor Gatis [mailto:[email protected]]
> *Sent:* Wednesday, August 06, 2008 6:34 PM
> *To:* Charlie Poole
> *Cc:* [email protected]
> *Subject:* Re: [Nunit-users] How do I debug break in case of assertion
> failure?
>
>   I'm wondering if Assert.XXX() functions call
> System.Diagnostics.Debugger.Break() if the user wants to. Is such mechanism
> available?
>
> On Wed, Aug 6, 2008 at 5:27 PM, Charlie Poole <[email protected]
> > wrote:
>
>>  If you use Visual Studio, you can tell it to break as soon as an
>> AssertionException
>> is thrown. Other IDEs will probably have similar functionality.
>>
>> Charlie
>>
>>  ------------------------------
>> *From:* [email protected] [mailto:
>> [email protected]] *On Behalf Of *Igor Gatis
>> *Sent:* Wednesday, August 06, 2008 1:38 PM
>> *To:* [email protected]
>> *Subject:* [Nunit-users] How do I debug break in case of assertion
>> failure?
>>
>>   When an assertion fails, I'd like to start my preferred debugger. How
>> do I enable that?
>>
>>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Nunit-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nunit-users
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
Nunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nunit-users