TDataSeries<T>
This commit is contained in:
+17
-17
@@ -106,11 +106,11 @@ var
|
||||
begin
|
||||
predicateCallCount := 0;
|
||||
dummyPredicate :=
|
||||
function(Item: IMyTestInterface): Boolean
|
||||
begin
|
||||
Inc(predicateCallCount);
|
||||
Result := True;
|
||||
end;
|
||||
function(Item: IMyTestInterface): Boolean
|
||||
begin
|
||||
Inc(predicateCallCount);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
FNotifier.Lock;
|
||||
Assert.IsTrue(FNotifier.IsLocked, 'Notifier should be locked.');
|
||||
@@ -209,12 +209,12 @@ begin
|
||||
|
||||
itemsProcessedCount := 0;
|
||||
FNotifier.Notify(
|
||||
function(Item: IMyTestInterface): Boolean
|
||||
begin
|
||||
Inc(itemsProcessedCount);
|
||||
TMyTestReceiver(Item).Foo;
|
||||
Result := Item.GetValue <> 20; // Remove item with value 20
|
||||
end
|
||||
function(Item: IMyTestInterface): Boolean
|
||||
begin
|
||||
Inc(itemsProcessedCount);
|
||||
TMyTestReceiver(Item).Foo;
|
||||
Result := Item.GetValue <> 20; // Remove item with value 20
|
||||
end
|
||||
);
|
||||
|
||||
Assert.AreEqual(3, itemsProcessedCount, 'Notify predicate called for all 3 items.');
|
||||
@@ -229,12 +229,12 @@ begin
|
||||
itemsProcessedCount := 0;
|
||||
|
||||
FNotifier.Notify(
|
||||
function(Item: IMyTestInterface): Boolean
|
||||
begin
|
||||
Inc(itemsProcessedCount);
|
||||
TMyTestReceiver(Item).Foo;
|
||||
Result := True; // Keep remaining
|
||||
end
|
||||
function(Item: IMyTestInterface): Boolean
|
||||
begin
|
||||
Inc(itemsProcessedCount);
|
||||
TMyTestReceiver(Item).Foo;
|
||||
Result := True; // Keep remaining
|
||||
end
|
||||
);
|
||||
Assert.AreEqual(2, itemsProcessedCount, 'Notify predicate called for 2 remaining items.');
|
||||
Assert.AreEqual(1, rcv1.CallCount, 'Receiver1 called again.');
|
||||
|
||||
Reference in New Issue
Block a user