microsoft/bc-bench/al-test-generation
Claude Code and agent skill by microsoft/bc-bench
- vendor
Checking that the SKILL.md file is still in the repository.
Guide for creating AL tests for Microsoft Dynamics 365 Business Central. Use this when asked to write, create, or generate AL test codeunits, test procedures, or test automation for Business Central.
Install
npx vskill@latest install microsoft/bc-bench/al-test-generationSKILL.md
The same SKILL.md was published earlier as microsoft/bc-bench/al-test-generation.
To create AL tests for Microsoft Dynamics 365 Business Central, follow this process:
1. Analyze the Code Under Test
Before writing any test code:
- Read and understand the procedure or functionality being tested
- Trace through all code paths to identify UI interactions
- Examine table definitions for TableRelation constraints
2. Identify Required Handler Methods
CRITICAL: Tests fail with "Unhandled UI" errors when handlers are missing.
Look for these patterns in the code under test:
| Code Pattern | Required Handler | |
|---|---|---|
Confirm() | [ConfirmHandler] | |
Message() | [MessageHandler] | |
StrMenu() | [StrMenuHandler] | |
Page.Run() | [PageHandler] | |
Page.RunModal() | [ModalPageHandler] | |
Report.Run() or Report.RunModal() | [ReportHandler] | |
| Report request page | [RequestPageHandler] | |
Hyperlink() | [HyperlinkHandler] | |
Notification.Send() | [SendNotificationHandler] |
3. Analyze TableRelation Constraints
CRITICAL: Tests fail with validation errors when inserting data that violates TableRelation constraints.
Before inserting test data:
- Read the table definition for all fields receiving values
- Identify fields with
TableRelationproperties - Ensure related records exist before inserting test data
- Use Library functions (e.g.,
LibrarySales,LibraryPurchase) to create prerequisite data
4. Write Test Structure
Follow the AAA pattern (Arrange-Act-Assert):
5. Handler Method Signatures
6. Best Practices
- Use descriptive test procedure names that explain what is being tested
- One assertion concept per test
- Use Library Variable Storage to pass data between handlers and tests
- Do NOT verify values inside handler procedures
- Clean up test data in teardown or use transaction rollback
- Use
Initialize()procedure to set up common test fixtures
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 8 Jul 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/bcbench/agent/shared/instructions/microsoft-BCApps/skills/al-test-generation/SKILL.md
Popularity
- Repository stars
- 50
- Repository forks
- 19
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/bc-bench/al-test-generation)