Test Worksheet

The Test Framework is used to automate tests. If you have a certain process that has to be tested before you transport objects to your customer database you can write a codeunit with input and output parameters that will be tested before the transport is executed.

Create Test

Test Worksheet
Test Worksheet


You can find the Test Worksheet in menu Analyzing Tools or access it from the project- or transport card. If you add a test to a project it will be transported to your customer database and it can be tested before you do the transport.

A test has the following options:
Codeunit No.The codeunit that will execute the test.
Codeunit NameThe name of the codeunit.
No. of Input ParametersThe number of input parameters that is used in the test codeunit.
No. of Output ParametersThe number of output parameters that is used in the test codeunit. If one of the output parameters has another value the test will fail.
Maximum Duration (ms)If the duration of the test is longer than this value the test will fail.
Run Frequency
  • Only manual - The test will only be executed manually in the test worksheet.
  • Before transport The test will be executed before it is transported. This option is only available if the test is added to a project
  • Before every transport The test is executed every time a transport is done.
Last Test SucceededThe result of the last executed test.
Last Test ResultThe result of the last executed test. If an error has occurred the error message is shown in this field.

Example of a Test Codeunit

Codeunit 11102078 - OM - Test Example is a simplified example of how a test codeunit could look like.

Example
Example


This codeunit will test if in a new project the user that is validated in the first user role will be the active user. In this example you see that it has 1 input parameter and 1 output parameter.

Parameters
Parameters


The result of this test will be Test succeeded.

Test Succeeded
Test Succeeded


If you have done a modification to the project module which will result in another active user the test will fail and give you the result “Parameter 'ActiveUser' returned 'KOOS SPLINTER'. Must be 'REIJER MOLENAAR'

Test Failed
Test Failed


If you lower the maximum duration to 5 ms. the test will also fail and the result will be “Duration of test was 27 ms.”.

Performance Test
Performance Test