I am trying to use NCrunch with Steve Sanderson's demo project for MVC Integration Testing. His post about it is here:
Steve Sanderson's Postand the download of the project is here:
Sample Project DownloadMy problem is that the solution builds and tests OK from within Visual Studio, but I get the following error when trying to run NCrunch over it:
SetUp : System.InvalidOperationException : Could not load MvcIntegrationTestFramework.dll within a bin directory under C:\Users\idarroch\AppData\Local\NCrunch\13932\29\MyMvcApplication. Is this the path to your ASP.NET MVC application, and have you set up a post-build event to copy your test assemblies and their dependencies to this folder? See the demo project for an example.
at MvcIntegrationTestFramework.Hosting.AppHost..ctor(String appPhysicalDirectory, String virtualDirectory) in C:\Development\MVC\Downloaded Samples\IntegrationTesting\MvcIntegrationTestFramework\Hosting\AppHost.cs:line 31#0
at MvcIntegrationTestFramework.Hosting.AppHost..ctor(String appPhysicalDirectory) in C:\Development\MVC\Downloaded Samples\IntegrationTesting\MvcIntegrationTestFramework\Hosting\AppHost.cs:line 21#1
at MyMvcApplication.Tests.HomeControllerTests..ctor() in C:\Development\MVC\Downloaded Samples\IntegrationTesting\MyMvcApplication.Tests\HomeControllerTests.cs:line 15#2
The test is erroring on the following line:
appDomainProxy = (AppDomainProxy) ApplicationHost.CreateApplicationHost(typeof (AppDomainProxy), virtualDirectory, appPhysicalDirectory);where virtualDirectory = "/", and appPhysicalDirectory has been set to: Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory + "\\..\\..\\..\\MyMvcApplication")
It appears I need to get NCrunch to copy the whole MyMVCApplication folder into its test location. Is there a better way to do this to reduce performance issues?
Once I get the demo project working with NCrunch, I want to apply those lessons to my own integration test project, which is failing for the same reason.
Thanks