@@ -534,17 +534,21 @@ procedure TMethodData.RecordHit(const Args: TArray<TValue>; const returnType : T
534534
535535procedure TMethodData.StubNoBehaviourRecordHit (const Args: TArray<TValue>; const AExpectationHitCtr : Integer; const returnType: TRttiType; out Result: TValue);
536536begin
537- // If we have no return type defined, and the default return type is empty
538- if (returnType <> nil ) and (FReturnDefault.IsEmpty) then
539- begin
540- // Return the default value for the passed in return type
541- Result := GetDefaultValue(returnType);
542- end
543- else if FSetupParameters.BehaviorMustBeDefined and (AExpectationHitCtr = 0 ) and (FReturnDefault.IsEmpty) then
544- begin
545- // If we must have default behaviour defined, and there was nothing defined raise a mock exception.
546- raise EMockException.Create(Format(' [%s] has no behaviour or expectation defined for method [%s]' , [FTypeName, FMethodName]));
547- end ;
537+ MockNoBehaviourRecordHit(Args, AExpectationHitCtr, returnType, Result);
538+
539+ //
540+ // //If we have no return type defined, and the default return type is empty
541+ // if (returnType <> nil) and (FReturnDefault.IsEmpty) then
542+ // begin
543+ // //Return the default value for the passed in return type
544+ // Result := GetDefaultValue(returnType);
545+ // end
546+ // else if FSetupParameters.BehaviorMustBeDefined and (AExpectationHitCtr = 0) and (FReturnDefault.IsEmpty) then
547+ // begin
548+ // //If we must have default behaviour defined, and there was nothing defined raise a mock exception.
549+ // raise EMockException.Create(Format('[%s] has no behaviour or expectation defined for method [%s]', [FTypeName, FMethodName]));
550+ // end;
551+ // result := FReturnDefault;
548552end ;
549553
550554function TMethodData.Verify (var report : string) : boolean;
0 commit comments