mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 14:46:55 +01:00
- commit-shared-test-fixture-inside-lazy-initialize: three sub-issues.
Recommended TestIsolation = Codeunit instead of listing Disabled as an
equal option - Disabled never rolls back at all ("tests are not
isolated from each other" per the property's own docs), so a fixture
this pattern commits under Disabled is permanent database
contamination unless something else tears it down; Disabled is now
only mentioned alongside that explicit teardown requirement. Added
precedence in al-testing-review.md so the deliberate end-of-test
asserterror Error(...) rollback sentinel isn't also flagged by the
generic asserterror-needs-expectederror-and-code rule. Rewrote both
fixtures to actually demonstrate the pattern: persisted fixture data
(an Item record) instead of an empty comment, a second [Test] method
that depends on the fixture surviving into it, and an explicit
Subtype = TestRunner / TestIsolation = Codeunit runner codeunit.
- table-relation-test-exclude-known-invalid-relations-via-event:
the length/type rule was stated as one global requirement. Verified
ValidateFieldRelation in codeunit 134926 directly (BCApps reference
clone) and split it into the two branches the source actually has:
a field with any unconditional relation needs exact length and exact
resolved type; a field whose relations are all conditional only fails
on being shorter (longer is fine) than the largest related field, and
when the required type is specifically Code, a Text source passes too
- a tolerance that does not apply on the unconditional side and does
not extend to a required Text.
Rebased onto upstream/main (one conflict in
transactionmodel-attribute-governs-test-transactions.md - upstream had
already linked its sample references via the READ convention, ours
added a Source section; merged both). Also converted the 3 remaining
plain-backtick sample references in this PR to the READ-convention
markdown-link form, same fix as #156/#157/#158.
|
||
|---|---|---|
| .. | ||
| asserterror-needs-expectederror-and-code.bad.al | ||
| asserterror-needs-expectederror-and-code.good.al | ||
| asserterror-needs-expectederror-and-code.md | ||
| commit-shared-test-fixture-inside-lazy-initialize.bad.al | ||
| commit-shared-test-fixture-inside-lazy-initialize.good.al | ||
| commit-shared-test-fixture-inside-lazy-initialize.md | ||
| permission-tests-must-lower-the-execution-context.bad.al | ||
| permission-tests-must-lower-the-execution-context.good.al | ||
| permission-tests-must-lower-the-execution-context.md | ||
| table-relation-test-exclude-known-invalid-relations-via-event.bad.al | ||
| table-relation-test-exclude-known-invalid-relations-via-event.good.al | ||
| table-relation-test-exclude-known-invalid-relations-via-event.md | ||
| testisolation-belongs-on-the-test-runner.bad.al | ||
| testisolation-belongs-on-the-test-runner.good.al | ||
| testisolation-belongs-on-the-test-runner.md | ||
| transactionmodel-attribute-governs-test-transactions.bad.al | ||
| transactionmodel-attribute-governs-test-transactions.good.al | ||
| transactionmodel-attribute-governs-test-transactions.md | ||
| ui-handlers-in-tests.bad.al | ||
| ui-handlers-in-tests.good.al | ||
| ui-handlers-in-tests.md | ||
| use-assert-isfalse-not-asserterror-for-boolean-checks.bad.al | ||
| use-assert-isfalse-not-asserterror-for-boolean-checks.good.al | ||
| use-assert-isfalse-not-asserterror-for-boolean-checks.md | ||
| use-library-codeunits-for-test-fixtures.bad.al | ||
| use-library-codeunits-for-test-fixtures.good.al | ||
| use-library-codeunits-for-test-fixtures.md | ||