User:Rodasmith/wUnit/TestSuite

From Wiktionary, the free dictionary
Jump to navigation Jump to search

Usage

[edit]

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:

Unit tests for {{foo}}

  • Total number of tests: 2
  • Tests passed: 0
  • Tests failed: 2

Details

  1. Assertion failed. Expected: {{{expected}}}. Actual: {{{actual}}}
  2. User:Rodasmith/wUnit/Assert.IsEmpty