Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed expectations to use matches as well.
Previously matches were not being retrieved when an expectation was being called.
  • Loading branch information
staticcat committed Jul 30, 2015
1 parent 491ba1c commit fff942c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Delphi.Mocks.Expectation.pas
Expand Up @@ -144,8 +144,6 @@ constructor TExpectation.CreateWhen(const AMethodName: string; const Args: TArra
FMatchers := matchers;
end;



constructor TExpectation.CreateAfter(const AMethodName : string; const AAfterMethodName: string);
begin
Create(AMethodName);
Expand Down
3 changes: 3 additions & 0 deletions Delphi.Mocks.Proxy.pas
Expand Up @@ -478,6 +478,9 @@ procedure TProxy<T>.DoInvoke(Method: TRttiMethod; const Args: TArray<TValue>; ou
//first see if we know about this method
methodData := GetMethodData(method.Name, pInfo.NameStr);
Assert(methodData <> nil);

matchers := TMatcherFactory.GetMatchers;

case FNextExpectation of
OnceWhen : methodData.OnceWhen(Args, matchers);
NeverWhen : methodData.NeverWhen(Args, matchers) ;
Expand Down

0 comments on commit fff942c

Please sign in to comment.