Park testing knowledge files for later review

This commit is contained in:
Jeffrey Bulanadi 2026-06-15 07:55:26 +08:00
parent 822cae1b27
commit c4ecab140b
6 changed files with 167 additions and 0 deletions

View file

@ -0,0 +1,28 @@
codeunit 50102 "Customer Permission Tests"
{
Subtype = Test;
TestPermissions = Restrictive;
var
Assert: Codeunit Assert;
[Test]
procedure CustomerReadFailsWithoutPermission()
var
Customer: Record Customer;
begin
// Restrictive: test runner assigns no permission sets to the test user.
asserterror Customer.FindFirst();
Assert.ExpectedError('You do not have the following permissions');
end;
[Test]
[TestPermissions(TestPermissions::Disabled)]
procedure AdminCanReadAllCustomers()
var
Customer: Record Customer;
begin
// Disabled overrides codeunit-level Restrictive for this test only.
// Use for paths that legitimately require elevated access.
Customer.FindFirst();
end;
}