Address review: merge handler articles, adopt enqueue-driven pattern

Respond to @nikolakukrika's review on #62:

- Merge ui-calls-require-test-handlers, handlerfunctions-attribute-must-match-ui-path
  and handlers-enqueue-never-assert into a single ui-handlers-in-tests article.
- Adopt the enqueue-from-test / dequeue-and-assert-in-handler pattern using
  Assert.ExpectedConfirm/ExpectedMessage (substring match), with Initialize()
  clearing LibraryVariableStorage and AssertEmpty() proving exact call counts.
- asserterror sample now uses Assert.ExpectedTestFieldError + FieldCaption instead
  of hardcoded message/code; article text points to the library helpers.
- Drop the tablerelation article and fold its test-relevant ordering point
  (relations checked on Validate/Insert(true); build parents first) into
  use-library-codeunits-for-test-fixtures.

Article count 198 -> 195.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Jesper Schulz-Wedde 2026-07-07 09:29:32 +02:00
parent 587f199814
commit 373ec31e2e
18 changed files with 137 additions and 360 deletions

View file

@ -13,9 +13,12 @@ codeunit 50408 "Test AssertError Good"
// [WHEN] a mandatory field is blank
asserterror Customer.TestField(Name);
// [THEN] verify the SPECIFIC failure message and code not just "any error"
Assert.ExpectedError('Name must have a value');
Assert.ExpectedErrorCode('TestField');
// [THEN] verify the SPECIFIC failure through a reusable Library helper
// instead of hardcoding the localized message and the 'TestField' code.
// ExpectedTestFieldError centralizes that knowledge, so the test keeps
// working when the caption or code changes; FieldCaption avoids pinning
// the field name as a literal.
Assert.ExpectedTestFieldError(Customer.FieldCaption(Name), '');
end;
var