{"title":"Test attribute","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/attributes/devenv-test-attribute/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/attributes/devenv-test-attribute, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/attributes/devenv-test-attribute","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Specifies that the method is a test method.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":104,"chars":122},{"level":2,"title":"Syntax","slug":"syntax","at":226,"chars":305},{"level":2,"title":"Remarks","slug":"remarks","at":531,"chars":282},{"level":2,"title":"Related information","slug":"related-information","at":813,"chars":222}],"text":"> Version: _Available or changed with runtime version 1.0._\nSpecifies that the method is a test method.\n## Applies to\n Method\n> NOTE\n> The Test attribute can only be set inside codeunits with the SubType property set to Test.\n## Syntax\n> Version: _Available or changed with runtime version 1.0._\n```al\n[Test]\nprocedure Test()\n```\n> IMPORTANT\n> The above signature requires the Test method to be global. See https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-al-methods.md%23local-and-global-scope.\n## Remarks\nUse test methods to test specific units of application business logic. The transaction behavior of a test method depends on its TransactionModel<devenv-transactionmodel-attribute> setting.\nSee Test Codeunits and Test Functions<../devenv-test-codeunits-and-test-methods>.\n## Related information\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>\nTest Codeunits and Test Functions<../devenv-test-codeunits-and-test-methods>\ndevenv-transactionmodel-attribute"}