-
-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verify an overloaded method with params string[] #603
Comments
The C# compiler will bind the expression (If I misunderstood something, please post a small but complete code example that demonstrates the issue; a small failing unit test would be best.) |
Sorry, my error was this: https://stackoverflow.com/questions/32654730/verifying-moq-method-call-when-used-as-a-base-class-interface Message: Moq.MockException : Performed invocations: Thanks anyway! |
It can not explicitly verify this call cause it adds [] and tries to verify an overloaded method, but action calls the one without that param.
CALLED: mock.Verify(m => m.FindAsync(t => t.Id == 1, null, 0, 0), Times.Once);
VERIFIED: mock.Verify(m => m.FindAsync(t => t.Id == 1, null, 0, 0, []), Times.Once);
The methods are:
Task FindAsync(
Expression<Func<T, bool>> filter = null,
Func<IQueryable, IOrderedQueryable> orderBy = null,
int skip = 0,
int take = 0,
params string[] includeProperties);
Task FindAsync(
Expression<Func<T, bool>> filter = null,
Func<IQueryable, IOrderedQueryable> orderBy = null,
int skip = 0,
int take = 0);
Even with a setup it does not work.
The text was updated successfully, but these errors were encountered: