Implementing first "strategy" for proof of concept
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user