The content in this topic only applies to Microsoft Dynamics NAV 2009 SP1. For Microsoft Dynamics NAV 2009 content, see Developer and IT Pro Help for Microsoft Dynamics NAV 2009.
Executes before a test function of a test codeunit is run.
OnBeforeTestRun(CodeunitID : Integer;CodeunitName : Text;FunctionName : Text) Ok : Boolean
The ID of the codeunit to be run.
The name of the test codeunit to be run.
The name of the test function to be run.
This parameter is empty when the OnBeforeTestRun trigger is called for the entire test codeunit.
A test runner codeunit manages the execution of test codeunits that are run from its OnRun function. When a test codeunit runs, it executes each test function in the codeunit, one at a time. The OnBeforeTestRun trigger is called before the test codeunit, the OnRun function, and each test function.
The OnBeforeTestRun trigger is run in its own database transaction.
You can use the OnBeforeTestRun triggers to perform preprocessing, such as general initialization and logging, or to automate tests by integrating the test runner codeunit with a test management framework.
For more information, seeand .
The following OnBeforeTestRun trigger code initializes a logging variable and returns true to indicate that the test function should execute. This example requires that you create the following global variable.
Before := CURRENTDATETIME; EXIT(true);