From cc153dbf97516f1ecaadcc26ce06f42175b21ca6 Mon Sep 17 00:00:00 2001 From: Bartosz Kijonka Date: Fri, 1 Mar 2024 14:14:44 +0100 Subject: [PATCH] Additional Verify overload --- src/Moq/Mock`1.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Moq/Mock`1.cs b/src/Moq/Mock`1.cs index 83f757a67..527c5afa7 100644 --- a/src/Moq/Mock`1.cs +++ b/src/Moq/Mock`1.cs @@ -1033,6 +1033,22 @@ public void Verify(Expression> expression, Func Mock.Verify(this, expression, times(), null); } + /// + /// Verifies that a specific invocation matching the given expression was performed on the mock, + /// specifying a failure error message. + /// + /// Expression to verify. + /// The number of times a method is expected to be called. + /// Message to show if verification fails. + /// Type of return value from the expression. + /// + /// The invocation was not called the number times specified by . + /// + public void Verify(Expression> expression, Func times, string failMessage) + { + Mock.Verify(this, expression, times(), failMessage); + } + /// /// Verifies that a specific invocation matching the given expression was performed on the mock, /// specifying a failure error message.