Skip to content

Commit 6e407a0

Browse files
bkijonkakzu
authored andcommitted
Additional Verify overload
1 parent d465bf2 commit 6e407a0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Moq/Mock`1.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,22 @@ public void Verify<TResult>(Expression<Func<T, TResult>> expression, Func<Times>
10331033
Mock.Verify(this, expression, times(), null);
10341034
}
10351035

1036+
/// <summary>
1037+
/// Verifies that a specific invocation matching the given expression was performed on the mock,
1038+
/// specifying a failure error message.
1039+
/// </summary>
1040+
/// <param name="expression">Expression to verify.</param>
1041+
/// <param name="times">The number of times a method is expected to be called.</param>
1042+
/// <param name="failMessage">Message to show if verification fails.</param>
1043+
/// <typeparam name="TResult">Type of return value from the expression.</typeparam>
1044+
/// <exception cref="MockException">
1045+
/// The invocation was not called the number times specified by <paramref name="times"/>.
1046+
/// </exception>
1047+
public void Verify<TResult>(Expression<Func<T, TResult>> expression, Func<Times> times, string failMessage)
1048+
{
1049+
Mock.Verify(this, expression, times(), failMessage);
1050+
}
1051+
10361052
/// <summary>
10371053
/// Verifies that a specific invocation matching the given expression was performed on the mock,
10381054
/// specifying a failure error message.

0 commit comments

Comments
 (0)