Skip to content

Commit

Permalink
Skip DefaultValue.Mock behavior for matched invocations
Browse files Browse the repository at this point in the history
  • Loading branch information
stakx committed Jun 16, 2020
1 parent 39743fe commit 2b1b139
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Moq/Interception/InterceptionAspects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public static void Handle(Invocation invocation, Mock mock)
else
{
var returnValue = mock.GetDefaultValue(method, out var innerMock);
if (innerMock != null)
if (innerMock != null && invocation.MatchingSetup == null)
{
mock.AddInnerMockSetup(invocation, returnValue);
}
Expand Down

0 comments on commit 2b1b139

Please sign in to comment.