---
id: change/bcquality/159
type: change
title: "#159 3 AL/BC testing patterns from an external BC testing expert's blog (Luc van Vugt, fluxxus.nl)"
summary: "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."
tier: official
language: en
tags:
  - feature
  - main
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:03:52.830Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 830eaff68f92128dc764275d2b93b4b4e315ea77
evidence:
  - kind: code
    url: https://github.com/microsoft/BCQuality/pull/159
    title: "microsoft/BCQuality#159: 3 AL/BC testing patterns from an external BC testing expert's blog (Luc van Vugt, fluxxus.nl)"
    date: "2026-09-29"
    commit: 830eaff68f92128dc764275d2b93b4b4e315ea77
    t: null
    quote: "mined from a source outside CURABIS itself: Luc van Vugt's fluxxus.nl, a long-running blog by a BC/NAV developer"
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 159
repo: microsoft/BCQuality
source_id: bcquality-prs
url: https://github.com/microsoft/BCQuality/pull/159
kind: pr
base_branch: main
major: null
merged_at: "2026-09-29T15:13:07Z"
author: MichaelDieringer
author_type: User
community_contribution: false
labels: []
change_class: code
change_kind: feature
behavior_change: false
breaking: false
files:
  count: 12
  additions: 394
  deletions: 4
  al: 12
apps: []
objects_touched: []
objects_unjoined:
  - path: microsoft/knowledge/testing/asserterror-needs-expectederror-and-code.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/commit-shared-test-fixture-inside-lazy-initialize.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/commit-shared-test-fixture-inside-lazy-initialize.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/commit-shared-test-fixture-inside-lazy-initialize.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/table-relation-test-exclude-known-invalid-relations-via-event.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/table-relation-test-exclude-known-invalid-relations-via-event.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/table-relation-test-exclude-known-invalid-relations-via-event.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/transactionmodel-attribute-governs-test-transactions.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/use-assert-isfalse-not-asserterror-for-boolean-checks.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/use-assert-isfalse-not-asserterror-for-boolean-checks.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/use-assert-isfalse-not-asserterror-for-boolean-checks.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/skills/review/al-testing-review.md
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items: []
systems:
  - development
quote: "mined from a source outside CURABIS itself: Luc van Vugt's fluxxus.nl, a long-running blog by a BC/NAV developer"
joined_against:
  major: null
  commit: null
---

# #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.

[Pull request](https://github.com/microsoft/BCQuality/pull/159) · 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? snapshot
- `microsoft/knowledge/testing/commit-shared-test-fixture-inside-lazy-initialize.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/commit-shared-test-fixture-inside-lazy-initialize.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/commit-shared-test-fixture-inside-lazy-initialize.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/table-relation-test-exclude-known-invalid-relations-via-event.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/table-relation-test-exclude-known-invalid-relations-via-event.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/table-relation-test-exclude-known-invalid-relations-via-event.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/transactionmodel-attribute-governs-test-transactions.md`: modified, not in the BC? snapshot
- `microsoft/knowledge/testing/use-assert-isfalse-not-asserterror-for-boolean-checks.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/use-assert-isfalse-not-asserterror-for-boolean-checks.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/use-assert-isfalse-not-asserterror-for-boolean-checks.md`: added, not in the BC? snapshot yet
- `microsoft/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).
