TestPermissions attribute

Version: Available or changed with runtime version 1.0.

Specifies a value that can be used to determine which permission sets are used on tests that are run by a test method.

Applies to

  • Method

Note

The TestPermissions attribute can only be set inside codeunits with the SubType property set to Test.

Syntax

[TestPermissions(TestPermissions: TestPermissions)]

Arguments

TestPermissions
 Type: TestPermissions
Specifies the permission sets used on tests that are run by the test method.

Remarks

The InheritFromTestCodeunit option value for the TestPermissions argument is only relevant for test methods; not test codeunits. It specifies that a test method uses the TestPermissions property setting of the test codeunit to which it belongs. If you use this value on a test codeunit, the property will resolve to Restrictive at runtime.

Apart from InheritFromTestCodeunit, the values themselves do not perform any operations or have any specific behavior. Instead, you programmatically define what each value does, and the permissions sets it applies at runtime, by adding code in a test runner codeunit.

Note

To specify the permission sets that are used by all the tests run by a test codeunit, use the TestPermissions Property.

AL Method Reference
Method Attributes
TestPermissions Property