---
id: change/bcquality/62
type: change
title: "#62 Add testing knowledge: UI handlers, table relations, asserterror, fixtures (P1+P2)"
summary: "Adds three testing knowledge articles to BCQuality under microsoft/knowledge/testing: UI handlers in tests, pairing asserterror with expected error checks, and using library codeunits for test fixtures. Each article has a markdown page plus good and bad AL examples."
tier: official
language: en
tags:
  - feature
  - main
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:13:37.791Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 3aa3581f9563b64e6fa370cc722dbca23775f225
evidence:
  - kind: code
    url: https://github.com/microsoft/BCQuality/pull/62
    title: "microsoft/BCQuality#62: Add testing knowledge: UI handlers, table relations, asserterror, fixtures (P1+P2)"
    date: "2026-07-09"
    commit: 3aa3581f9563b64e6fa370cc722dbca23775f225
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 62
repo: microsoft/BCQuality
source_id: bcquality-prs
url: https://github.com/microsoft/BCQuality/pull/62
kind: pr
base_branch: main
major: null
merged_at: "2026-07-09T08:24:51Z"
author: JesperSchulz
author_type: User
community_contribution: false
labels: []
change_class: code
change_kind: feature
behavior_change: false
breaking: false
files:
  count: 9
  additions: 277
  deletions: 0
  al: 9
apps: []
objects_touched: []
objects_unjoined:
  - path: microsoft/knowledge/testing/asserterror-needs-expectederror-and-code.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/asserterror-needs-expectederror-and-code.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/asserterror-needs-expectederror-and-code.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/ui-handlers-in-tests.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/ui-handlers-in-tests.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/ui-handlers-in-tests.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/use-library-codeunits-for-test-fixtures.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/use-library-codeunits-for-test-fixtures.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/testing/use-library-codeunits-for-test-fixtures.md
    status: added
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items: []
systems:
  - development
quote: null
joined_against:
  major: null
  commit: null
---

# #62 Add testing knowledge: UI handlers, table relations, asserterror, fixtures (P1+P2)

> Adds three testing knowledge articles to BCQuality under microsoft/knowledge/testing: UI handlers in tests, pairing asserterror with expected error checks, and using library codeunits for test fixtures. Each article has a markdown page plus good and bad AL examples.

[Pull request](https://github.com/microsoft/BCQuality/pull/62) · merged into `main` on 2026-07-09 by JesperSchulz · 9 files (+277 -0), 9 AL · feature · tier official · reviewed (checked by Opus)

## What changed

- New article on UI handlers needed for UI calls in tests
- New article on pairing asserterror with Assert.ExpectedError and ExpectedErrorCode
- New article on using library codeunits instead of hand-rolled Init/Insert fixtures
- Each article ships as a markdown file with good and bad AL samples
- Content targets BC-specific test mechanics that LLMs tend to get wrong

## AL objects touched

- `microsoft/knowledge/testing/asserterror-needs-expectederror-and-code.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/asserterror-needs-expectederror-and-code.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/asserterror-needs-expectederror-and-code.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/ui-handlers-in-tests.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/ui-handlers-in-tests.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/ui-handlers-in-tests.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/use-library-codeunits-for-test-fixtures.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/use-library-codeunits-for-test-fixtures.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/testing/use-library-codeunits-for-test-fixtures.md`: added, not in the BC? snapshot yet

## Context

- Systems: development

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