User:Rodasmith/wUnit

Hello, you have come here looking for the meaning of the word User:Rodasmith/wUnit. In DICTIOUS you will not only get to know all the dictionary meanings for the word User:Rodasmith/wUnit, but we will also tell you about its etymology, its characteristics and you will know how to say User:Rodasmith/wUnit in singular and plural. Everything you need to know about the word User:Rodasmith/wUnit you have here. The definition of the word User:Rodasmith/wUnit will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofUser:Rodasmith/wUnit, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

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 {{foo}}, 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:

Template:foo/test

Components

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

E.g.:

==Unit tests for {{temp|foo}}==
{{User:Rodasmith/wUnit/TestSuite |
{{User:Rodasmith/wUnit/Assert.AreEqual| {{foo|bar|1}} | <span class="bar">1</span> }} |
{{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

Assertion failed. Expected: {{{expected}}}. Actual: {{{actual}}}

User:Rodasmith/wUnit/Assert.IsEmpty