From 2b1b13903e9dbb1a077723c41a6c91bcb5bf490d Mon Sep 17 00:00:00 2001 From: stakx Date: Tue, 16 Jun 2020 21:31:10 +0200 Subject: [PATCH] Skip `DefaultValue.Mock` behavior for matched invocations --- src/Moq/Interception/InterceptionAspects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Moq/Interception/InterceptionAspects.cs b/src/Moq/Interception/InterceptionAspects.cs index f2b63f8c9..0bd196c2e 100644 --- a/src/Moq/Interception/InterceptionAspects.cs +++ b/src/Moq/Interception/InterceptionAspects.cs @@ -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); }