IF NumberOfTests > 0 THEN
FOR IteratorCounter := 1 TO NumberOfTests BY 1 DO
IF Tests[IteratorCounter].GetName() = TestName THEN
SetTestFinished := TRUE; RETURN;
SetTestFinished := FALSE;
if not for the return, the method resets the flag immediately after setting it. It might also clear other set flags.