Skip to content

nealhoang/MvcIntegrationTests

 
 

Repository files navigation

Failing Tests

When writing an integration test for an ASPNET 5 MVC project which uses Microsoft.AspNet.TestHost, if the integration test is in a separate project to the MVC site, the test will fail with the error:

System.InvalidOperationException : The view ‘Index’ was not found. The following locations were searched:
 /Views/Home/Index.cshtml
 /Views/Shared/Index.cshtml

When running the site in IIS Express or Kestrel it works fine, and the test passes if written in the same project as the MVC site. It would appear other people have had similar issues (reading the comments):

Setup

  • Visual Studio 2015 Community
  • 2 x Blank ASPNET 5 RC1 project
  • xunit 2.1.0
  • xunit.runner.dnx 2.1.0-rc1-build204
  • Microsoft.AspNet.TestHost 1.0.0-rc1-final
  • Microsoft.AspNet.Mvc 6.0.0-rc1-final

About

Example failing test for RC1 MVC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%