Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Moq/Mock`1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,22 @@ public void Verify<TResult>(Expression<Func<T, TResult>> expression, Func<Times>
Mock.Verify(this, expression, times(), null);
}

/// <summary>
/// Verifies that a specific invocation matching the given expression was performed on the mock,
/// specifying a failure error message.
/// </summary>
/// <param name="expression">Expression to verify.</param>
/// <param name="times">The number of times a method is expected to be called.</param>
/// <param name="failMessage">Message to show if verification fails.</param>
/// <typeparam name="TResult">Type of return value from the expression.</typeparam>
/// <exception cref="MockException">
/// The invocation was not called the number times specified by <paramref name="times"/>.
/// </exception>
public void Verify<TResult>(Expression<Func<T, TResult>> expression, Func<Times> times, string failMessage)
{
Mock.Verify(this, expression, times(), failMessage);
}

/// <summary>
/// Verifies that a specific invocation matching the given expression was performed on the mock,
/// specifying a failure error message.
Expand Down