|
|
|
|
|
- Overview
- How to create the test?
- To create an automatic test on a procedure (or on a class method):
Automatic tests of procedures and classes
The automatic tests of procedure or class are used to test the different features proposed by the procedure or by the class. Remark: Use in Windows Vista (and later): To record and replay the automatic unit tests, the UAC mechanism must be disabled. To create an automatic test on a procedure (or on a class method): 1st method - Display the "Project explorer" pane if necessary.
- In the "Project explorer" pane, select the name of the method or the name of the global or local procedure whose test must be run.
- Select "Unit tests .. Create a unit test" in the popup menu.
- A new test scenario is automatically created. The test scenario contains the call to the function. The code required to run the test of the procedure or the test of method must be written by the developer. If parameters are expected by the method or by the procedure, you have the ability to create a set of data for test.
2nd method - Display the "Code" pane if necessary.
- In the "Code" pane, select the name of the method or procedure whose test must be run.
- Select "Unit tests .. Create a unit test" in the popup menu.
- A new test scenario is automatically created. The test scenario contains the call to the function. The code required to run the test of the procedure or the test of method must be written by the developer. If parameters are expected by the method or by the procedure, you have the ability to create a set of data for test.
3rd method - Display the procedure or the method in the code editor.
- On the "Automated tests" tab, in the "Tests" group, expand "New" and select "Record a new scenario".
- A new test scenario is automatically created. The test scenario contains the call to the function. The code required to run the test of the procedure or the test of method must be written by the developer. If parameters are expected by the method or by the procedure, you have the ability to create a set of data for test.
Related Examples:
|
Training (WINDEV): WD Example of unit test
[ + ] This example presents the use of the test editor included in WINDEV: - test of a window - test of a global procedure - test of a global procedure from a set of test data (available from the versions 12)
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|