Creating and Executing a Suite of Unit Tests
Here are the basic steps for creating and executing a suite of unit tests:
Create a class (or more than one) that contains methods that you would like to test.
Create a test class (or more than one test class) that extends %UnitTest.TestCaseOpens in a new window.
Add methods to the test class that will test your method output. Use at least one assertion (AssertX macro) in each method. Begin each test method name with Test.
Export the test class(es) to a file.
Open the Terminal and change to the namespace containing the class(es) that you are going to test. Assign to ^UnitTestRoot a string containing the path to the parent of the directory that contains the exported test class files.
In the Terminal, run %UnitTest.Manager.RunTest passing it the name of the (child) directory that contains the test class files.
Review the test reports. The output in the Terminal includes a URL for a web page that display the results in easy-to-read tables.
The following pages provide more detail as well as step-by-step examples for creating and executing a set of unit tests.