Adds a failure to the list of failures.Applies to
TTestResult
Declaration
Function AddFailure(test: ITest; e: Exception): TTestFailure;

Description
Creates a TTestFailure recording that a failure occurred in test. Notifies any registered ITestListeners that a failure occurred. The TTestFailure returned should not be freed.
test | The test that failed. |
e | The exception that caused the failure. |
Returns
The TTestFailure object representing this failure.Implementation
function TTestResult.AddFailure(test: ITest; e: Exception): TTestFailure;
var
i: integer;
Failure : TTestFailure;
begin
assert(assigned(test));
assert(assigned(e));
assert(assigned(fFailures));
Failure := TTestFailure.Create(test, e);
fFailures.add(Failure);
for i := 0 to fListeners.count - 1 do
begin
(fListeners[i] as ITestListener).AddFailure(Failure);
end;
assert(assigned(Failure));
Result := Failure;
End; |
HTML generated by Time2HELP
|
http://www.time2help.com