帮助配置MSpec [英] Help configuring MSpec

查看:172
本文介绍了帮助配置MSpec的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

rig:win7 64bit,vs2010,mvc v2,TestDriven.Net 3.0,Reshaper 5.0,MSpec 0.3

rig: win7 64bit, vs2010, mvc v2, TestDriven.Net 3.0, Reshaper 5.0, MSpec 0.3

我最近开始了一个新项目,并想使用mspec.

i recently started a new project and want to use mspec.

(1)将Machine.Specifications.ReSharperRunner.5.0.dll和Machine.Specifications.dll复制到JetBrains \ ReSharper \ 5.0 \ Bin \ Plugins \ Machine.Specifications(2)将Machine.Specifications.TDNetRunner.dll复制到TestDriven. NET 3 \ Machine.Specifications

(1) copied Machine.Specifications.ReSharperRunner.5.0.dll and Machine.Specifications.dll to JetBrains\ReSharper\5.0\Bin\Plugins\Machine.Specifications (2) copied Machine.Specifications.TDNetRunner.dll to TestDriven.NET 3\Machine.Specifications

当我尝试运行测试时,出现以下错误:System.IO.FileNotFoundException:无法加载文件或程序集'Machine.Specifications

when i try to run the test i get this error: System.IO.FileNotFoundException: Could not load file or assembly 'Machine.Specifications

我不知道此错误来自何处.

i don't know where this error is coming from.

vs2010菜单-> ReSharper->插件显示MSpec插件. vs2010菜单-> ReSharper->选项->工具->单元测试还会显示MSpec单元测试提供程序,但是当我单击它时,它不会显示任何详细信息,就像MSTest和nUnit一样.

vs2010 menu -> ReSharper ->Plugins shows the MSpec plugin. vs2010 menu ->ReSharper -> Options -> Tools -> Unit Testing also shows the MSpec unit testing provider but it doesn't show any details when i click on it as does MSTest and nUnit.

我发现了这一点: http://marcinobel.com/index.php/mspec-bdd-installer/无效.我还尝试了以下方法: http://eduncan911.com/blog/registering-mspec-runners-for-testdriven-net-on-windows-x64.aspx 也不起作用.现在我担心我搞砸了我的注册表.

i found this: http://marcinobel.com/index.php/mspec-bdd-installer/ which didn't work. i also tried this: http://eduncan911.com/blog/registering-mspec-runners-for-testdriven-net-on-windows-x64.aspx which also didn't work. now i fear i screwed my registry.

任何指导吗?

完全错误:

测试'F:Tests.OTBRadio.Tasks.AlbumTasksSpecs.when_the_album_tasks_are_asked_to_get_all.context'失败:无法加载文件或程序集'Machine.Specifications,版本= 0.3.0.0,文化=中性,PublicKeyToken =空'或其中之一依赖关系.该系统找不到指定的文件. System.IO.FileNotFoundException:无法加载文件或程序集"Machine.Specifications,Version = 0.3.0.0,Culture = neutral,PublicKeyToken = null"或其依赖项之一.该系统找不到指定的文件. 文件名:'Machine.Specifications,Version = 0.3.0.0,Culture = neutral,PublicKeyToken = null' 在Machine.Specifications.TDNetRunner.SpecificationRunner.RunMember(ITestListener testListener,程序集程序集,MemberInfo成员) 在TestDriven.TestRunner.AdaptorTestRunner.Run(ITestListener testListener,ITraceListener traceListener,字符串assemblyPath,字符串testPath) 在TestDriven.TestRunner.ThreadTestRunner.Runner.Run()

Test 'F:Tests.OTBRadio.Tasks.AlbumTasksSpecs.when_the_album_tasks_are_asked_to_get_all.context' failed: Could not load file or assembly 'Machine.Specifications, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException: Could not load file or assembly 'Machine.Specifications, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'Machine.Specifications, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' at Machine.Specifications.TDNetRunner.SpecificationRunner.RunMember(ITestListener testListener, Assembly assembly, MemberInfo member) at TestDriven.TestRunner.AdaptorTestRunner.Run(ITestListener testListener, ITraceListener traceListener, String assemblyPath, String testPath) at TestDriven.TestRunner.ThreadTestRunner.Runner.Run()

推荐答案

您无需将Machine.Specifications.TDNetRunner.dll复制到任何地方,只需将其放置在项目的toolslib目录中即可,即您保留项目依赖项的位置.包含MSpec测试的项目将引用此目录中的Machine.Specifications.dll.只要Machine.Specifications.dll.tdnet位于同一目录中,TestDriven.Net> = 2.24将能够提取TD.Net运行程序.在此处.

You do not need to copy Machine.Specifications.TDNetRunner.dll anywhere, just place it in your project's tools or lib directory, i.e. where you keep your project's dependencies. The project containing the MSpec tests will reference the Machine.Specifications.dll from this directory. TestDriven.Net >=2.24 will be able to pick up the TD.Net runner as long as Machine.Specifications.dll.tdnet is located in the same directory. An example how I like to organize my tools directory can be found here.

您的ReSharper 5.0插件目录对我来说不错.但是,我有用户报告说,当您解压缩MSpec zip文件时(您很可能是从 http://teamcity下载的)下载的. Windows使用资源管理器将Windows标记为从Internet下载的提取的DLL.

Your ReSharper 5.0 plugin directory looks good to me. However, I've had users reporting that when you unzip the MSpec zip file (that you likely downloaded from http://teamcity.codebetter.com) using Explorer, Windows marks the extracted DLLs as being downloaded from the Internet.

可以通过打开每个DLL的属性并在第一个属性页上单击取消阻止"来确保Windows不会阻止<ReSharper 5.0>\bin\plugins中的DLL.如果未显示取消阻止"按钮,则文件正常.在这种情况下,请在此处发布,我们将看看如何使用您的MSpec插件.

Can you please make sure that Windows does not block the DLLs in <ReSharper 5.0>\bin\plugins by opening each DLL's properties and clicking "Unblock" on the first property page. In case the "Unblock" button is not displayed, your files are okay. In that case, please post here and we'll see how we can your MSpec plugin working.

这篇关于帮助配置MSpec的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆