#159 3 AL/BC testing patterns from an external BC testing expert's blog (Luc van Vugt, fluxxus.nl)
Adds three AL testing knowledge articles drawn from Luc van Vugt's blog: excluding known invalid relations in Table Relation Test through the OnAfterRemoveTableRelation event, committing shared fixture data inside a lazy Initialize(), and using Assert.IsFalse rather than asserterror around Assert.IsTrue.
- 12files
- 12AL files
- 0objects
Pull request · merged into main on 2026-09-29 by MichaelDieringer · 12 files (+394 -4), 12 AL · feature · tier official · reviewed (checked by Opus)
What changed
- Table Relation Test’s OnAfterRemoveTableRelation event can exclude known invalid relations
- Shared fixture data created in a lazy Initialize() needs an explicit Commit() or it rolls back after the first test
- Use Assert.IsFalse for boolean checks; asserterror only verifies an error was raised
- The Table Relation Test hook was checked against BCApps source
- A Confirm/StrSubstNo candidate and two other candidates were dropped
AL objects touched
microsoft/knowledge/testing/asserterror-needs-expectederror-and-code.md: modified, not in the BC? snapshotmicrosoft/knowledge/testing/commit-shared-test-fixture-inside-lazy-initialize.bad.al: added, not in the BC? snapshot yetmicrosoft/knowledge/testing/commit-shared-test-fixture-inside-lazy-initialize.good.al: added, not in the BC? snapshot yetmicrosoft/knowledge/testing/commit-shared-test-fixture-inside-lazy-initialize.md: added, not in the BC? snapshot yetmicrosoft/knowledge/testing/table-relation-test-exclude-known-invalid-relations-via-event.bad.al: added, not in the BC? snapshot yetmicrosoft/knowledge/testing/table-relation-test-exclude-known-invalid-relations-via-event.good.al: added, not in the BC? snapshot yetmicrosoft/knowledge/testing/table-relation-test-exclude-known-invalid-relations-via-event.md: added, not in the BC? snapshot yetmicrosoft/knowledge/testing/transactionmodel-attribute-governs-test-transactions.md: modified, not in the BC? snapshotmicrosoft/knowledge/testing/use-assert-isfalse-not-asserterror-for-boolean-checks.bad.al: added, not in the BC? snapshot yetmicrosoft/knowledge/testing/use-assert-isfalse-not-asserterror-for-boolean-checks.good.al: added, not in the BC? snapshot yetmicrosoft/knowledge/testing/use-assert-isfalse-not-asserterror-for-boolean-checks.md: added, not in the BC? snapshot yetmicrosoft/skills/review/al-testing-review.md: modified, not in the BC? snapshot
Context
- Systems: development
- From the description: “mined from a source outside CURABIS itself: Luc van Vugt’s fluxxus.nl, a long-running blog by a BC/NAV developer”
Source: metadata of a merged pull request in microsoft/BCQuality (bcquality): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).