Expectation on Mock Object doesn't seem to be met (Moq)
问题 I'm experiencing some odd behavior in Moq - despite the fact that I setup a mock object to act a certain way, and then call the method in the exact same way in the object I'm testing, it reacts as if the method was never called. I have the following controller action that I'm trying to test: public ActionResult Search(string query, bool includeAll) { if (query != null) { var keywords = query.Split(' '); return View(repo.SearchForContacts(keywords, includeAll)); } else { return View(); } } My