This section provides an overview of what nunit is, and why a developer might want to use it.
It should also mention any large subjects within nunit, and link out to the related topics. Since the Documentation for nunit is new, you may need to create initial versions of those related topics.
NUnit's Assert.That()
form supports the use of constraints as its second parameter. All constraints provided out of the box by NUnit are available through the static classes Is
, Has
and Does
. Constraints can be combined into fluent expressions using the built in methods And
, Or
and With
. Expressions can be conveniently expanded up using the many methods in ConstraintExpression
, such as AtMost
and Contains
.
Version 1 of NUnit used the classic approach to identifying tests based on inheritance and naming conventions. From version 2.0 on, NUnit has used custom attributes for this purpose.
Because NUnit test fixtures do not inherit from a framework class, the developer is free to use inheritance in other ways. And because there is no arbitrary convention for naming tests, the choice of names can be entirely oriented toward communicating the purpose of the test.
All NUnit attributes are contained in the NUnit.Framework namespace. Each source file that contains tests must include a using statement for that namespace and the project must reference the framework assembly, nunit.framework.dll.
Beginning with NUnit 2.4.6, NUnit's attributes are no longer sealed and any attributes that derive from them will be recognized by NUnit.