Roy Osherove

View Original

Nice article on Extending the NUnit Assert methods

Charlie Poole (The new father of NUnit) wrote this nice draft article about a subject I never touched: Extending the Assert class in NUnit.

"Development of a set of customized assertion methods is a key to productive test-writing for NUnit. In many cases, a private method in one of your test fixtures will be all that is needed. In others, you may wish to deploy one or more assertions so that they can be reused by the entire development team.

NUnit's new Assert extensibility model allows tailoring specific assertions for your application in a way that is consistent with the basic NUnit assertions. These extensions can provide messages that are consistent in appearance with those provided by NUnit and use features of the NUnit framework to avoid duplication."