4

I'm trying to get Steven Sanderson's MvcIntegrationTestFramework to work with our MVC 4 application. I really like the idea of being able to write integration tests that does not require a browser yet tests the entire flow.

I can’t get this to run. When I execute a very simple test all I get is this:

Unable to create instance of class website.tests.UnitTest1. Error: System.InvalidOperationException: Could not load MvcIntegrationTestFramework.dll within a bin directory under C:[path]\Website. 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..

It is the correct path to the MVC application and I’ve put the test project beside it in the solution. I’ve also set up the post-build copy string and it copies the .dll files which I verify by looking in the MVC apps bin folder. Still it claims it can’t find the MvcIntegrationTestFramework.dll

I’m using MSTest as test framework.

Does anyone know how to solve this?

tereško
  • 58,060
  • 25
  • 98
  • 150
Peter
  • 249
  • 2
  • 3
  • I switched to NUnit instead and got past this problem. I'd say it's something to do with how MSTest works internally. Still, the question remains if anyone have seen this before and if so, how it's remedied? – Peter Apr 23 '12 at 00:27

1 Answers1

3

This version was updated for MVC3, I'm having fairly good results with it so far:

https://github.com/JonCanning/MvcIntegrationTestFramework

I've forked this too and added support for file uploads.

https://github.com/Steji/MvcIntegrationTestFramework

Steji
  • 580
  • 1
  • 6
  • 17
  • Steji I am trying to use it with mvc 5. Is this just impossible (i.e. do I have to rewrite it for mvc 5)? One problem I am having is that a global filter, which is registered just does not have any effect (it works fine when I test the app manually). – cs0815 Jul 30 '14 at 08:39
  • I'm afraid I haven't tried it with MVC5, I haven't been using this for a little while now either. You may need to rewrite it – Steji Jul 30 '14 at 13:04