Run Unit Tests

The test method can include other methods that do not follow these rules. ​

You can use the setup() method that is built into the framework to arrange the variables that will be used throughout the test methods. For example, if you have a variable currencyAmt that is used in multiple test methods, instead of creating a variable for currencyAmt in each test method, you would only need to create it in the setup() method.​

You can choose from several different assert methods to verify the test. AssertEquals() is the most common, but other methods are available, such as assertTrue() and assertNotNull(). You can also use the code this.parmExceptionExpected(true) to assert that an error thrown is the correct behavior.​

After the test class is created, you can right-click the class and select Run tests. This selection will open the unit test toolbar. Using unit tests can be a fast and reliable way to develop code. Over time, you will build new tests as new functionality is added. This allows you to quickly run these unit tests to make sure that everything works as expected. For information, see SysTest Filtering using class and method attributes.​