topic hubAL Developmentofficial - Microsoftunreviewed - model text not yet checked

Testing

Testing best practices for Business Central extensions: how to build and test a sample Customer Rewards extension with the Application Test Toolkit, and what testing is required before submitting an extension to Marketplace validation. It answers questions about test codeunits, UI handlers, mocking, and pre-submission checks.

Path: Development > Rules, guidelines, and best practices > Best practices > Testing · tier official · system development · narrative unreviewed (model text not yet checked)

Overview

This section covers testing for Business Central extensions from two angles. Two pages walk through a worked example: one builds an advanced sample extension called Customer Rewards, and the other tests it. The third page lists the testing requirements and procedures developers must follow before they submit an extension to Marketplace validation.

The build walkthrough uses codeunits, tables, pages, events and an Assisted Setup wizard. It includes testing hooks exposed through event publishers. The test page then uses the Application Test Toolkit. It covers test codeunits, test pages, UI handlers, and mocking of external service calls.

Start with “Building an Advanced Sample Extension” and “Test the advanced sample extension” if you want to learn the patterns. Go to “Testing your extension” if you are preparing a submission and need the checklist.

Key points

  • Building an Advanced Sample Extension creates a Customer Rewards extension with codeunits, tables, pages, events and an Assisted Setup wizard.
  • The sample uses event publishers and subscribers, table extensions, page extensions and installation logic.
  • Event publishers in the sample provide testing hooks.
  • Testing the sample uses the Application Test Toolkit with test codeunits and test pages.
  • UI interactions in tests are handled with MessageHandler, ConfirmHandler and StrMenuHandler.
  • External service calls are mocked in the sample’s tests.
  • Testing your extension lists the requirements before Marketplace validation: testing in an online environment, code signing, installation verification, user permission testing, demo data import and republish testing.

Learn pages

Videos, posts and code changes

Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 3 Learn pages