mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-06 15:16:56 +01:00
Address second round of Jesper Schulz-Wedde's review on PR #159
- commit-shared-test-fixture-inside-lazy-initialize.md: fundamentally
rewritten. AutoCommit is the documented default TransactionModel, not
AutoRollback. Explains the real mechanism (Commit() protects a fixture
from the test method's own later deliberate rollback, per Codeunit.Run/
TransactionModel-property semantics) and the TestIsolation dependency
(Disabled/Codeunit survive across methods, Function does not). Fixtures
rewritten to demonstrate the actual failure/success shape.
- transactionmodel-attribute-governs-test-transactions.md: now states the
AutoCommit default explicitly and agrees with the article above, closing
the contradiction Jesper flagged between the two testing articles.
- Deleted confirm-needs-strsubstno-before-confirmhandler-sees-substituted-text
(.md/.good.al/.bad.al): the underlying platform bug (microsoft/
ALAppExtensions#23935) was closed as completed in Feb 2024; cannot be
reproduced or bc-version-pinned on any currently supported version.
- table-relation-test-exclude-known-invalid-relations-via-event.md: added
the [Scope('OnPrem')] boundary verified against BCApps' Table Relation
Test codeunit.
- use-assert-isfalse-not-asserterror-for-boolean-checks.md: added a Scope
section resolving the overlap with asserterror-needs-expectederror-and-code.
- al-testing-review.md: fixed the shared-fixture cue to catch the actual
anti-pattern instead of the compliant shape, added the missing cue for
use-assert-isfalse-not-asserterror-for-boolean-checks, wired precedence
between it and the generic asserterror rule, and removed the cue for the
deleted article.
- Added in-file Source provenance (specific fluxxus.nl post per article,
with what was independently verified vs. taken from the post) to the
three surviving externally-inspired articles, per Jesper's request that
provenance live in the knowledge file itself, not only the PR description.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
dcd79afc08
commit
1392521a8e
10 changed files with 65 additions and 61 deletions
|
|
@ -1,9 +1,12 @@
|
|||
codeunit 50142 "Sample Test Library"
|
||||
{
|
||||
Subtype = Test;
|
||||
|
||||
var
|
||||
Initialized: Boolean;
|
||||
RollBackMsg: Label 'Revert back the tables to their original state.';
|
||||
|
||||
procedure Initialize()
|
||||
local procedure Initialize()
|
||||
begin
|
||||
if Initialized then
|
||||
exit;
|
||||
|
|
@ -17,4 +20,14 @@ codeunit 50142 "Sample Test Library"
|
|||
begin
|
||||
// insert master/setup data shared across every test in this codeunit
|
||||
end;
|
||||
|
||||
[Test]
|
||||
procedure FirstTestUsesSharedFixture()
|
||||
begin
|
||||
Initialize();
|
||||
|
||||
// exercise/verify against the shared fixture, then make scratch changes of its own
|
||||
|
||||
asserterror Error(RollBackMsg);
|
||||
end;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue