PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Overview
  • How to create the test?
  • To create an automated 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/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
The automated 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.
How to create the test?

To create an automated 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 "Unit tests .. Create a unit test" in 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 the method or procedure expects parameters, you can create a test data set.
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 "Unit tests .. Create a unit test" in 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 the method or procedure expects parameters, you can create a test data set.
3rd method
  1. Display the procedure or the method in the code editor.
  2. On the "Automated tests" tab, in the "Tests" group, expand "New" and select "Record 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 the method or procedure expects parameters, you can create a test data set.
4th method (only for creating the first test scenario on a procedure)
  1. Display the procedure or the method in the code editor.
  2. Open the context menu of the arrow in the procedure banner and select "Create an associated test".

    Remarks:
    • If no test scenario is associated with the procedure, the arrow will appear on a gray background . If one or more tests are associated with the procedure, the icon will appear on a green background .
    • If a test has already been associated with the procedure, the context menu of the arrow allows you to:
      • run all the scenarios associated with the procedure .
      • see the tests associated with the procedure (i.e. the scenarios that directly or indirectly call the procedure).
  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 the method or procedure expects parameters, you can create a test data set.
Remark: Regardless of the method used to create a test scenario, you can create a test data set. To create this data set, use TestAddIteration. For more details, see Code of scenario.
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 version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment