Question

The NUnit Test Adapter for VS 2012 allows you to run NUnit tests from within the Visual Studio 2012 IDE via the Test Explorer. However, the reason I have NUnit tests in the first place is because I have tests written against SharePoint 2010 (I know, these are Integration Tests, not Unit Tests), which, due to the requirement that the SharePoint API be accessed through a 64-bit client means that MSTest/VS can't run them.

I was hoping that with the NUnit Test Adapter, however, I would be able to run the SharePoint tests from within Test Explorer in Visual Studio but I keep getting the error message:

SetUp failed for test fixture xyz
SetUp : System.IO.FileNotFoundException : The Web application at http://sp could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

This indicates to me that the NUnit Test Adapter is running as a 32-bit process (I suspect the process is vstest.executionengine.x86.clr20.exe).

Is there any way to run NUnit tests that target SharePoint 2010 using the NUnit Test Adapter and Test Explorer in Visual Studio 2012?

Was it helpful?

Solution

To run tests in 64-bit process:

  • In Visual Studio 2012, select TEST->Test Settings->Default Processor Architecture->x64 menu item
  • With vstest.console.exe, specify /Platform:x64 command line option.

You may also be interested in SharePoint Emulators, which allow you run SharePoint integration tests in isolation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top