我将翻译如下内容:
智能感知知道我的控制器有一个名为QuoteEndCustomerSearch的方法。但是当我调试时,我会收到上述错误。
控制器的方法如下所示:
我遇到了这个错误:
结果堆栈跟踪:在 UnitTestProject.ControllerTest.TestMethodQuoteEndCustomerSearch() Result Message: 测试方法 UnitTestProject.ControllerTest.TestMethodQuoteEndCustomerSearch 抛出异常:System.MissingMethodException: 找不到方法:'System.Web.Mvc.ActionResult QuoteCenter.Controllers.ECSearchController.QuoteEndCustomerSearch(System.String, System.String, System.String, System.String)'。
我的测试类看起来像这样:
namespace UnitTestProject
{
[TestClass]
public class ControllerTest
{
[TestMethod]
public void TestMethodQuoteEndCustomerSearch()
{
//arrange
ECSearchController myController = new ECSearchController();
//ISSUE WITH THE NEXT LINE
ViewResult result = myController .QuoteEndCustomerSearch("", "", "", "") as ViewResult;
}
}
}
智能感知知道我的控制器有一个名为QuoteEndCustomerSearch的方法。但是当我调试时,我会收到上述错误。
控制器的方法如下所示:
[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post)]
public ActionResult QuoteEndCustomerSearch(String quoteId, String CID, String URL, String UserID)
{
//...
return View("QuoteEndCustomerSearch", model);
}
有什么其他建议吗?我已经在管理员模式下,并且重新启动了VS2015,但还是无法正常工作。