Re: FW: Classic or Constraint-Based Assert Model?
"Chris Wright" <[email protected]> Mon, 7 Jul 2008 15:49:21 -0400
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <[email protected]> |
2008/7/7 Cillian Sheppard <[email protected]>: > 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? Assert.That(obj1.GetRandomResult(), Is.SameAs(expected[0]) | Is.SameAs(expected[1])); Assert.That(obj2.ToArray(), Has.Some.SameAs(item1) & Has.Some.SameAs(item2)); ------------------------------------------------------------------------- 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