Implementing first "strategy" for proof of concept

This commit is contained in:
Michael Schimmel
2025-07-11 11:06:18 +02:00
parent 644b6074d6
commit 487169afe0
20 changed files with 1761 additions and 274 deletions
+6 -6
View File
@@ -74,8 +74,8 @@ end;
procedure TMycTestNotifierTests.Setup;
begin
FNotifier.Create;
// FNotifier's internal FFirst is now 1 (unlocked, not finalized)
FNotifier := Default(TMycNotifyList<IMyTestInterface>);
end;
procedure TMycTestNotifierTests.TearDown;
@@ -92,7 +92,7 @@ procedure TMycTestNotifierTests.Test01_DestroyExecutesWithoutErrors;
begin
// This call is expected to succeed without raising EAssertionFailed or other exceptions
// if TMycNotifyList.Destroy is implemented correctly.
FNotifier.Destroy;
FNotifier.Finalize;
Assert.IsTrue(True, 'FNotifier.Destroy completed without raising an exception.');
end;
@@ -102,11 +102,11 @@ end;
procedure TMycTestNotifierTests.Test02_NotifyOnFinalizedLockedEmptyListExecutesWithoutErrors;
var
predicateCallCount: Integer;
dummyPredicate: TPredicate<IMyTestInterface>;
dummyPredicate: TMycNotifyList<IMyTestInterface>.TNotifyProc;
begin
predicateCallCount := 0;
dummyPredicate :=
function(Item: IMyTestInterface): Boolean
function(const Item: IMyTestInterface): Boolean
begin
Inc(predicateCallCount);
Result := True;
@@ -209,7 +209,7 @@ begin
itemsProcessedCount := 0;
FNotifier.Notify(
function(Item: IMyTestInterface): Boolean
function(const Item: IMyTestInterface): Boolean
begin
Inc(itemsProcessedCount);
TMyTestReceiver(Item).Foo;
@@ -229,7 +229,7 @@ begin
itemsProcessedCount := 0;
FNotifier.Notify(
function(Item: IMyTestInterface): Boolean
function(const Item: IMyTestInterface): Boolean
begin
Inc(itemsProcessedCount);
TMyTestReceiver(Item).Foo;