在Visual Studio 2013测试代理上使用Shims运行测试

Pet*_*udd 6 unit-testing visual-studio microsoft-fakes visual-studio-2013



我已经在许多网站上找到了这个问题的各种迭代,但到目前为止,我还没有找到任何提供完整答案的东西.我刚刚设置了许多Visual Studio测试代理,这些代理似乎都在运行,并且正在运行我们计划在其上运行的大多数单元测试.然而,当我来到检查单元测试中,它未能就行之一:
using (ShimsContext.Create()),

随着堆栈跟踪: 看了我安装了Visual Studio 2013的测试代理一些其他职位,并证实将在本地运行测试.然后我将COR_PROFILER_PATH设置为我的机器上使用的分析器,该分析器安装在:"C:\ Program Files\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\12.0.0\Microsoft.IntelliTrace.Profiler .12.0.0.dll".然后它在跟踪的同一个地方失败了: 建议是在一个单独的进程下加载了探查器而无法使用.有没有人在这个或类似的设置上取得任何成功?在基础层面上,Visual Studio Test Agents可以使用Fakes运行测试吗? 谢谢
Result Message:
Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: Failed to resolve profiler path from COR_PROFILER_PATH and COR_PROFILER environment variables.

Test method threw exception:
Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: Failed to get profiler module handle 'C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\12.0.0\Microsoft.IntelliTrace.Profiler.12.0.0.dll'. The specified module could not be found ---> System.ComponentModel.Win32Exception: The specified module could not be found


ter*_*ryg 5

我知道这有点旧了,所以OP可能得到了他的答案,但对于其他人来说,我就这个问题向微软开了一张票,我们在一个半小时查看我的设置后得到了答案问题:

Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException:无法从 COR_PROFILER_PATH 和 COR_PROFILER 环境变量解析探查器路径。

,是我正在使用mstest.exe并且我应该使用vstest.console.exe。就我而言,这是因为我的代码中现在有 Fakes 测试。

我正在使用 Visual Studio 2013 更新 4。