User:Rodasmith/wUnit/TestSuite
From Wikipedia
< User:Rodasmith | wUnit
[edit] Usage
The TestSuite class takes a variable number of assertions as parameters. It reports the total number of assertions, the number of assertions passed, and the number of assertions failed.
Invoke it as follows:
==Unit tests for {{temp|foo}}==
{{User:Rodasmith/wUnit/TestSuite |
{{User:Rodasmith/wUnit/Assert.AreEqual| 1 | {{foo|bar|1}} }}
{{User:Rodasmith/wUnit/Assert.IsEmpty| {{foo|||}} }}
}}
The results of the above test follow:
-
[edit] Unit tests for {{foo}}
- Total number of tests: 2
- Tests passed: 0
- Tests failed: 2
-
[edit] Details
- Assertion failed. Expected: 1 . Actual: Template:Foo
- Assertion failed. Expected empty result. Actual: Template:Foo