"Run Tests"在MonoDevelop中的位置是什么?

36

我已经有一个包含NUnit测试的库的解决方案。在使用Visual Studio开发时,我通常会使用我在项目中的tools\nunit文件夹中包含的nunit.exe二进制文件来运行这些测试。

现在我正在使用monodevelop开发相同的解决方案。我相当确定我记得monodevelop有一个集成的“运行测试”操作,我想使用它来运行测试。根据这篇文章,应该有一个“查看-单元测试”菜单项。然而,我一定做错了/特殊的事情,因为我找不到它。

如何在Monodevelop中运行我的NUnit测试?


请检查您正在运行的MonoDevelop版本。2.6不存在,最新版本是2.4.1。另外,您使用的操作系统是哪个? - Lluis Sanchez
@Lluis:我一定混淆了Monodevelop的版本和Mono的版本,昨晚我发这个问题时很累。平台是Ubuntu 10.04,但我可能从其他地方安装了更新的Monodevelop软件包,甚至可能是从源代码编译的。我稍后会再次检查并提供更多细节。 - Wim Coenen
4个回答

32

试一下这个:

sudo apt-get install monodevelop-nunit

最令人难过的事情是:NUnit 3的支持在Xamarin Studio 6.0.0.4514中添加。(来自https://bugzilla.xamarin.com/show_bug.cgi?id=35915)我使用的是Linux Mint,但仍然是Monodevelop 5.x版本。 - maxkoryukov

29
如果你正在使用Ubuntu,请确保通过软件包管理器安装了MonoDevelop NUnit插件。一旦安装完成,点击"View -> Pads -> Unit Tests",将会显示单元测试面板,然后你可以双击运行测试夹具。请注意保留原文中的html标签。

所有你需要的都在这里:https://dev59.com/WW855IYBdhLWcg3wcz1h#7570288,目前,这是下一个答案))) - maxkoryukov

11

目前为止,答案可以总结如下:

  1. sudo apt-get install monodevelop-nunit
  2. 选择菜单项:View | Pads | Unit Tests

在干净的 Ubuntu 12.04 和 MonoDevelop 2.8.6.3 的安装中测试过。


2

我不记得在Mono Develop中有内置的“运行测试”操作。但是你可以使用一个插件。

Enabling the NUnit Add-in

The NUnit addin requires mono 1.1.9+. This is do to some cross-appdomain bug fixes. Debian users currently also have another particular problem in that NUnit packages are separated from Mono, and do not include the proper pkg-config files.

Configure monodevelop with the following command.

./configure --enable-nunit 

Debian users only

Install the nunit and libnunit-cil packages (requires unstable at this moment). Due to the separate packaging of nunit, we need to make a symlink so that monodevelop knows where to find the pkg-config file.

ln -s /usr/lib/pkgconfig/nunit.pc /usr/lib/pkgconfig/mono-nunit.pc

编辑:我在这里找到了更多信息:http://www.codeproject.com/KB/tips/NUnit_MonoDevelop.aspx。如果这不起作用,我明天可能会在我的mono开发中尝试,您使用的是哪个平台?


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接