User:Rodasmith/wUnit

Purpose
Wiki templates can become complex. When one template relies on other templates, changes to one can affect the other in subtle ways.

To manage such complexity, most other software development environments incorporate automated unit testing into each project. Many modern successful unit test suites are built on jUnit and nUnit, but wiki templates have no such framework. Enter wUnit, a unit testing framework for wiki templates.

Usage
To execute a wUnit test suite, execute it by invoking the test suite, typically located in a "test" subdirectory of the template to test. The test suite for a template, for example, would be at Template:foo/test. Including the test suite will execute it and show the total number of tests, the number of tests that passed, and the number of tests that fail.

E.g., the test suite at Template:foo/test currently shows the following results:



Components
A package of assertion methods is at User:Rodasmith/wUnit/Assert.

E.g.:

The results of the above test follow:
 * Unit tests for