2

VS 2012的NUnit Test Adapter允许您通过测试浏览器从Visual Studio 2012 IDE中运行NUnit测试。但是,首先我有NUnit测试的原因是因为我有针对SharePoint 2010编写的测试(我知道,这些测试是集成测试,而不是单元测试),由于需要通过64位访问SharePoint API位客户端意味着MSTest/VS不能运行它们。如何使用适用于Visual Studio 2012的NUnit测试适配器来运行SharePoint测试?

我希望与NUnit的测试适配器,不过,我将能够从测试资源管理器在Visual Studio中运行SharePoint测试,但我不断收到错误消息:

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. 

这就说明我说NUnit测试适配器是作为一个32位进程运行的(我怀疑这个进程是vstest.executionengine.x86.clr20.exe)。

有什么办法可以在Visual Studio 2012中使用NUnit测试适配器和测试浏览器来运行以SharePoint 2010为目标的NUnit测试?

回答

2

要运行在64位进程测试:

  • 在Visual Studio 2012中,选择测试 - >测试设置 - >缺省处理器建筑 - >的x64菜单项
  • 随着vstest.console.exe,指定/ Platform:x64命令行选项。

您可能也有兴趣SharePoint Emulators,它允许您单独运行SharePoint集成测试。

+0

太棒了,谢谢!不能使用仿真器 - 我现在没有VS 2012 Ultimate ... –

相关问题