NUnit syntax helper classes
After a few days, I discovered NUnit Helper Classes.
I've looked at the NUnit site, wiki, and did a google site-search, but I can't find solid documentation on it. It's mentioned here and there, but no real documentation.
It's mentioned in the release notes for version 2.5, but I can't find anything besides that.
http://nunit.org/?p=releaseNotes&r=2.5Is there documentation on this开发者_运维技巧, or is it just trail and error?
Start with the documentation on the Constraint-Based testing model. This is where "is", "has", "text" (actually obsoleted by string constraints), and "list" (in the documentation as List Mapper) are.
"Throws" is just an Exception Assert that's implemented as a method on Assert().
I see your point there doesn't seem to be a formal page that documents all methods on "is". It might be because there's so much functionality in that class that spans many use cases. You'll see "is" mentioned on almost all of the sub pages. Personally once I understood the constraint model, I threw "is" into the Visual Studio object browser and things became clear fairly quickly.
This is an old question, but looking at the framework github repo will allow you to see the actual helper classes.
Read the following PDF tutorial; it will explain you how to use each attribute of NUnit:
NUnit overview and tutorial (Justin Crites, Rice University, TX)
精彩评论