视觉工作室2010中的Moles / NUnit [英] Moles/NUnit in visual studio 2010

查看:53
本文介绍了视觉工作室2010中的Moles / NUnit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我们正在使用VS 2010 IDE进行开发,我们的项目基于框架3.5(CLR 2.0)。我们一直在使用NUnit作为单元测试框架,现在想选择Moles作为我们的隔离工具。

Hello, we are using VS 2010 IDE for development and our projects are based on framework 3.5 (CLR 2.0). We have been using NUnit as the unit testing framework and now would like to choose Moles as our isolation tool.

我目前正在使用最新的鼹鼠版本:v0.94.51006.1。

I am currently on the latest moles release: v0.94.51006.1.

1。我在使用nunit-console的moles.runner.exe下运行测试时没有问题,但是,我还想在Visual Studio中运行(并调试)测试。有没有办法在Visual Studio中运行基于NUnit / Moles的测试?我目前使用Resharper
5来主持单元测试(这不是必需的,我可以更改测试托管工具)。我可以在visual studio中运行基于Moles / MSTests的测试,但是,如果我切换到NUnit,它会一直抱怨"Moles要求测试是一个仪表化的
过程"。我无法切换到MSTest,因为需要切换到Framework 4.任何建议都会有所帮助。

1. I have no problems running the tests under moles.runner.exe with nunit-console, however, I would also like to run ( and debug) the tests from within Visual Studio. Is there a way to run NUnit/Moles based tests within Visual Studio? I currently use Resharper 5 to host the unit tests ( this is not a necessity, i could change the test hosting tool). I am able to run Moles/MSTests based tests from within visual studio, however, if i switch to NUnit, it keeps complaining "Moles requires tests to be an instrumented process". I cannot switch to MSTest as that requires a switch to Framework 4. Any suggestions would be helpful.

2。我还想生成单元测试的代码覆盖率。目前我们使用NCover。我从这个论坛的另一个帖子中读到,可以通过一些分析器链接技术将NCover和moles.runner.exe结合起来。我想知道更多
详情,了解这可能是什么 非常感谢。

2. I would also like to generate the code coverage for unit tests. Currently we use NCover. I read from another thread in this forum that it is possible to combine NCover and moles.runner.exe via some profiler chaining technique. I would like to know more in details on how this could be  achieved.

非常感谢。

推荐答案

你好,

 

Hello,

 

我实际上有两个相同的问题:

I actually have the same 2 problems:

1。我想知道如何让Nunit在VS(2008)中运行鼹鼠。或者至少如何调试。 (/ boss param让VS显示一个文本框说:moles.runner.exe触发了一个断点,但是继续,测试只是继续)

1. I would like to know how to get Nunit with moles running in VS (2008). Or at least how to debug. (/boss param makes VS show a textbox saying:moles.runner.exe has triggered a breakpoint, but on continue, tests just continue)

2。而且我也想知道如何使用痣工作。这可能是通过命令行。

2. And I would also like to know how to get ncover working with moles. This may be via the command line.

我最近联系过NCover一个带有痣的MStest项目,因为它总是说覆盖率为0%,而测试成功并且必须至少覆盖部分该项目。我得到了响应NCover还不支持Moles。因此,令我惊讶的是,我在另一个主题中读到
,NCover通过链接与Moles合作。但那是什么链接,它是如何工作的?关于这一点的一些信息会很棒:)

I recently contacted NCover for a MStest project with moles, because it always said coverage 0%, while the tests succeeded and must at least cover a part of the project. I got the response NCover doesn't support Moles yet. So it surprises me that I read in another topic that NCover works with Moles through chaining. But what's that chaining and how does it work? Some info on this would be great :)

问候,

Tom


这篇关于视觉工作室2010中的Moles / NUnit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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