topic hubAL Developmentofficial - Microsoftreviewed - checked by Opus

Testing

Testing best practices for Business Central extensions: a Customer Rewards sample extension built and then tested with the Application Test Toolkit, plus the testing steps required before Marketplace validation. It answers questions about writing test codeunits and about pre-submission checks.

Path: Development > Rules, guidelines, and best practices > Best practices > Testing · tier official · system development · narrative reviewed (checked by Opus)

Overview

This section covers testing extensions from two angles. Two pages follow one sample, a Customer Rewards extension. The first builds it with tables, table extensions, pages, page extensions, codeunits and events, and adds assisted setup, activation codes and reward levels. The second tests that sample with the Application Test Toolkit.

The third page is about submission. It lists what developers must test before sending an extension to Marketplace validation, including online environment testing, code signing, installation, user permissions, demo data and republishing.

Start with “Building an Advanced Sample Extension” to get the sample in place, then read “Test the advanced sample extension” for the test patterns. Use “Testing your extension” as a checklist before submitting.

Key points

  • The Customer Rewards sample adds reward level tracking to customers and shows how to develop, test and publish an extension.
  • The sample uses tables, table extensions, pages, page extensions, codeunits, events, assisted setup and activation codes.
  • Tests use the Application Test Toolkit with test codeunits and test methods.
  • The testing walkthrough covers UI handlers, test pages, the asserterror statement and mock event subscribers.
  • It also shows how to validate business logic in the sample.
  • Before Marketplace validation, test in an online environment and verify code signing and installation.
  • Pre-submission checks also include 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