Refactoring
This commit is contained in:
@@ -36,9 +36,6 @@ type
|
||||
procedure TestFuncLazy_GetChanged_IsAlwaysTrueAfterCreation;
|
||||
[Test]
|
||||
procedure TestFuncLazy_FirstPop_AlwaysEvaluatesAndResetsChanged;
|
||||
[Test]
|
||||
procedure TestFuncLazy_Pop_WhenProcIsNull_FirstPopReturnsTrueAndValueUnchanged_ResetsChanged;
|
||||
|
||||
// Tests for behavior after the initial "changed" state is consumed
|
||||
[Test]
|
||||
procedure TestFuncLazy_AfterFirstPop_IfNoSourceChange_GetChangedIsFalse;
|
||||
@@ -205,31 +202,6 @@ begin
|
||||
Assert.IsFalse(funcLazy.GetChanged.IsSet, 'Changed.IsSet should be false after the first Pop, as Pop resets it');
|
||||
end;
|
||||
|
||||
procedure TTestMycCoreLazy.TestFuncLazy_Pop_WhenProcIsNull_FirstPopReturnsTrueAndValueUnchanged_ResetsChanged;
|
||||
var
|
||||
funcLazy: IMycLazy<Integer>;
|
||||
value: Integer;
|
||||
preCallValue: Integer;
|
||||
result: Boolean;
|
||||
sourceDirty: IMycFlag;
|
||||
begin
|
||||
sourceDirty := TFlag.CreateFlag;
|
||||
sourceDirty.Reset;
|
||||
funcLazy := TMycFuncLazy<Integer>.Create(sourceDirty.State, nil);
|
||||
Assert.IsNotNull(funcLazy, 'TMycFuncLazy<Integer> instance should not be nil');
|
||||
Assert.IsTrue(funcLazy.GetChanged.IsSet, 'Changed state should be true before Pop by design');
|
||||
preCallValue := 123;
|
||||
value := preCallValue;
|
||||
result := funcLazy.Pop(value);
|
||||
Assert.IsTrue(result, 'First Pop should return true by design, even if FProc is nil');
|
||||
Assert.AreEqual(
|
||||
preCallValue,
|
||||
value,
|
||||
'Value should be unchanged as FProc was nil and current Pop implementation does not assign Default(T)'
|
||||
);
|
||||
Assert.IsFalse(funcLazy.GetChanged.IsSet, 'Changed state should be false after Pop');
|
||||
end;
|
||||
|
||||
// == Tests for TMycFuncLazy<T> - Behavior After Initial Pop ==
|
||||
|
||||
procedure TTestMycCoreLazy.TestFuncLazy_AfterFirstPop_IfNoSourceChange_GetChangedIsFalse;
|
||||
|
||||
Reference in New Issue
Block a user