❔ How to code cover lambda expression with NSubstitute and FluentValidation on line 26?
Question from title:
2 Replies
not sure what you're asking
if I'm reading this right......
you can do 2 things
A) don't use
.ReturnsforAnyArgs()
setup that method on the sub to actually USE the parameters that are passed in, to simulate the building of a proper query result
B) manually inspect the list of invocations upon the repository sub
to extract the delegate that was passed
and in the test against it
most people are gonna say either "A", or "neither, you're way overthinking"
there's definitely an argument to be made about how much value you get out of repo-level testing like this
I find that data-access testing is most effective when you use the REAL data access layer, but with fake data injected into itWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.