I have the following unit test:
[TestMethod]
public void Add_Returns_Edit_View()
{
ActionResult result = _controller.Add();
result.AssertViewRendered().ForView("Edit");
}
This must be passed, since the Add action returns an Edit view. However, this statement fails with the following exception:
MvcContrib.TestHelper.ActionResultAssertionException: Expected view name 'Edit', actual was '~/Views/JobSearch/Edit.cshtml'
Why is the view name returned as the fully qualified path name? Could this be due to my use of T4MVC, and if so, how can I convey this?
Change View Add is as follows: public virtual ActionResult Add()
{
return View(MVC.JobSearch.Views.Edit, new JobSearch());
}
source
share