I have a repository that has a method like this.
FindFirstOrDefault<TEntity>(Expression<Func<TEntity, bool>> expression, params Expression<Func<TEntity, object>>[] includes)
My Mock setup looks like this:
_repositoryMock.Setup(moq => moq.FindFirstOrDefault(It.IsAny<Expression<Func<Order, bool>>>(), It.IsAny<Expression<Func<Order, object>>[]>()))
I've also tried this:
_repositoryMock.Setup(moq => moq.FindFirstOrDefault(It.IsAny<Expression<Func<Order, bool>>>(), Array.Empty<Expression<Func<Order, object>>>()))
Previously when I had just one parameter to that FindFirstOrDefault method (the expression
parameter) it ran just fine. Now that I have added the includes
parameter I get the following error:
Invalid callback. Setup on method with 2 parameter(s) cannot invoke callback with different number of parameters (1).
Why am I getting an error that says I'm only passing 1 parameter when I am passing two?