With Unit Test Assistant you can easily create multiple test cases for methods from an abstract class and its super classesa selected class, as well as files or packages selected in the Project Explorer. The methods are analyzed to create runnable test cases with initial values and sample assertions, which can be easily modified or uncommented. You can add test cases using the UTA interface or the Eclipse context menu.
- If the Unit Test Assistant view is not already open, choose Parasoft> Show View> Unit Test Assistant from the Eclipse menu bar.
- Select a class in the editor.
- Click the Add test case(s) button.
- Select the methods you want to create test cases for and specify the test type: regular or parameterized (see Creating a Parameterized Unit Test for details on creating parameterized test cases).
- Click OK.
- View the tests to modify or uncomment the default UTA values if necessary.
- Run the test with UTA to collect coverage information and recommendations for possible improvements (see Executing Unit Tests with Unit Test Assistant).
Alternatively, you can add test cases using the Eclipse context menu:
- You can specify the test type (regular or parameterized), but you cannot specify individual methods.
- UTA will skip the files that are not testable or whose corresponding test classes already exist.