Using Moq to test methods that accept non-primative arguments
问题 I'm trying to write a test for an ASP.Net MVC controller action. I'd like to test that the action invokes a particular method on an injected service, so I'm mocking the service and using .Verify. So in the simple case, I have the following action in my controller: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(string title) { _cmsService.AddPage(title); return View("Edit"); } using the service interface... public interface ICmsService { void AddPage(string request); } and the