PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • How to create the test?
  • To create an automatic test on a procedure (or on a class method):
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
The automatic tests of procedure or class are used to test the different features proposed by the procedure or by the class.
Note: Use in Windows Vista (and later): To record and replay the automatic unit tests, the UAC mechanism must be disabled.
How to create the test?

To create an automatic test on a procedure (or on a class method):

1st method
  1. Display the "Project explorer" pane if necessary.
  2. 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.
  3. Select "Create a unit test" from the popup menu.Select "Unit tests .. Create a unit test" from the popup menu.
  4. 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
  1. Display the "Code" pane if necessary.
  2. In the "Code" pane, select the name of the method or procedure whose test must be run.
  3. Select "Create a unit test" from the popup menu.Select "Unit tests .. Create a unit test" from the popup menu.
  4. 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
  1. Display the procedure or the method in the code editor.
  2. Select "Automatic tests .. Record a new test".On the "Automatic tests" pane, in the "Tests" group, expand "New" and select "Save a new test".On the "Automatic tests" pane, in the "Tests" group, expand "New" and select "Save a new scenario".
  3. 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.
Note: To create a set of test data, use TestAddIteration. See Code of scenario for more details.
Related Examples:
WD Example of unit test 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)
Minimum required version
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment