Re: FW: Classic or Constraint-Based Assert Model?

"Charlie Poole" <[email protected]> Mon, 7 Jul 2008 12:18:28 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <003e01c8e066$3f46f500$6401a8c0@ferrari>
Hi Cillian,
 
Classic will continue to be supported, in the sense that it will keep
working. However, new constraints will be added to the constraint-based
model, while the corresponding assertions may not always be added to the
classic model. In fact, I have turned down or rewritten a number of proposed
enhancements that were implemented directly as an Assert, without providing
a corresponding constraint.
 
Here's an example of something simple, which you can't do in a single
(classic) assert:
 
  Assert.That( myStringArray, Is.All.Length.GreaterThan(5) );
 
 
Beyond that, there are certain things that are fundamentally impossible
using the classic model:
* combining multiple assertions into one
* writing extended assertions that work seamlessly with existing ones - you
can still write them of course
* passing assertions as arguments to other assertions
 
If you never do any of the above - you might call them "advanced" -
techniques, then classic asserts will work for you. OTOH,
you won't get to try any such techniques either. :-)
 
Charlie


  _____  

From: [email protected]
[mailto:[email protected]] On Behalf Of Cillian
Sheppard
Sent: Monday, July 07, 2008 10:12 AM
To: [email protected]
Subject: [Nunit-users] FW: Classic or Constraint-Based Assert Model?



Hi all,

 

I am just wondering if anyone could give me their opinion as to which
assertion model I should use for my NUnit unit tests; Classic or
Constraint-Based Assert Model. I have read the related documentation on the
website but the only significant difference I see is greater readability
with the latter. But does it add any real functionality? What would be a
good example of where it would be an advantage to use constraint-based
assert? What are the main pros and cons of each? I gather from the website
that classic will continue to be supported - or is their a future date at
which it will not?

 

Any help would be very much appreciated.

 

Regards

Cillian Sheppard.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08

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