Edit

TestHandlerContext data type

Version: Available or changed with runtime version 18.0.

Provides context information about a test codeunit or procedure being run. Used as a parameter in ITestHandler interface methods.

Instance methods

The following methods are available on instances of the TestHandlerContext data type.

Method name Description
CodeunitId() Gets the ID of the test codeunit being run.
CodeunitName() Gets the fully qualified name of the test codeunit being run.
ProcedureName() Gets the name of the test procedure being run. Empty for codeunit-level events.
Skip(Text) Marks the current test case or procedure to be skipped. When called from a before-hook (OnBeforeTestCaseRun or OnBeforeTestProcedureRun), the test body is not executed and the case is reported as skipped. Calling it from an after-hook has no effect.
Success() Gets whether the test codeunit or procedure completed successfully. Only meaningful in OnAfter events.
TestCaseName() Gets the name of the test case being run. Only populated for data-driven test case events.

Getting started with AL
Developing extensions
Test codeunits and test methods in AL
TestDataSource attribute
DataSourceContext data type