Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

FunctionType Property

Sets the type of function in a test codeunit.

C/AL functions on test codeunits. A test codeunit is codeunit that has the SubType Property (Codeunit) set to Test.

Value Description

Normal

Acts as normal function.

Test

Tests the application.

MessageHandler

Handles MESSAGE functions.

ConfirmHandler

Handles CONFIRM functions.

StrMenuHandler

Handles STRMENU functions.

PageHandler

Handles specific pages that are not run modally.

ModalPageHandler

Handles specific pages that are run modally.

ReportHandler

Handles specific reports.

You create test codeunits to test your application. A test codeunit can consist of one or more test functions, handler functions, and normal functions.

  • You use test functions that include C/AL code that performs a test on an area of the application. For more information, see How to: Create Test Codeunits and Test Functions.

  • You use handler functions to automate tests by handling instances when user interaction is required by the code that is being tested by the test function. In these instances, the handler function is run instead of the requested user interface. The handler function should simulate the user interaction for the test case, such as validating messages, making selections, or entering values. For example, a test function that has a FunctionType of MessageHandler handles MESSAGE function calls. If the code that is being tested calls the MESSAGE function, then the MessageHandler function that is declared for that test function is called instead of the MESSAGE function. You write code in the MessageHandler function to verify that the expected message is displayed by the MESSAGE function.

    Ee414210.note(en-us,NAV.70).gifNote
    The parameters of the functions that are being handled are passed as parameters to the handler functions. The value of the parameter can be changed by the handler function.

    To set up handler function for use by a test function, you assign the handler function to the HandlerFunctions Property of the test function.

    For more information, see How to: Create Handler Functions.

  • You use normal functions to structure the test code by using the same design practices and principles as functions in other codeunits of the application.

Show:
© 2015 Microsoft