The Unit Test Assistant view is a dynamic interface that allows you to create, run, monitor, and enhance unit tests. It can detect tests that have been created for the class or method selected in the editor and display actions available for this particular class or method.
- Choose Parasoft> Show View> Unit Test Assistant to enable the Unit Test Assistant interface.
- Open a source file in the editor and click a class or method to display available actions and the number of tests that have been created for it.
- Switch between the test and the source class with the and buttons.
The Unit Test Assistant view is context-sensitive and displays actions that are available for the current selection in the editor. You can perform an action by clicking on its label or icon.
For example, the following action links may be available:
- Source class - navigates to the source class.
- Run all - runs all tests in the method's class (see Executing Unit Tests with Unit Test Assistant).
- Run test[method_name] - runs the test for the selected method (see Executing Unit Tests with Unit Test Assistant).
- Track [method_name] - runs the test and displays information about the values that changed during execution (see Tracking Object Changes and Creating Assertions).
- Regular - creates a regular test (see Creating a Basic Unit Test).
- Parameterized - creates a parameterized test (see Creating a Parameterized Unit Test).
- Add test case(s) - adds multiple regular or parameterized tests (see Creating Multiple Unit Tests and Creating a Parameterized Unit Test).
- Mock - creates mocks (see Creating Mocks).
- Instantiate - instantiates objects.
You can enable or disable showing action labels by selecting or deselecting the Show action labels option in the UTA interface menu. If disabled, the Unit Test Assistant view only displays action icons:
The actions that the Unit Test Assistant view displays for a selection in the editor are also available in the context menu. Right-click a class or method in the editor and choose Unit Testing to view the available actions.