【问题标题】:Running nunit-tests from the command line从命令行运行 nunit-tests
【发布时间】:2013-03-14 15:14:08
【问题描述】:

我在尝试运行 nunit-console Testsuite.sln

时得到以下输出
NUnit version 2.4.8
Copyright (C) 2002-2007 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.

Runtime Environment - 
   OS Version: Unix 11.4.0.0
  CLR Version: 2.0.50727.1433 ( 2.10.11 (mono-2-10/2baeee2 Wed Jan 16 16:40:16 EST 2013) )

Missing method .ctor in assembly /Users/administrator/Desktop/projectname/testsuite/bin/Debug/Testsuite.dll, type NUnit.Framework.TestFixtureAttribute
Can't find custom attr constructor image: /Users/administrator/Desktop/projectname/testsuite/bin/Debug/Testsuite.dll mtoken: 0x0a000004
Could not load file or assembly 'nunit.framework, Version=2.6.0.12051, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies.

有什么建议吗?在 mono develop 中从 testrunner 运行测试没有问题。

【问题讨论】:

  • 可能有问题,但这不是版本冲突吗?运行的版本是2.4.8,在找nunit.framework 2.6.0?
  • 不知道 nunit 控制台版本必须与 nunit 版本匹配 - 正在寻找,谢谢。
  • 好的,尝试通过 NUnit 2.6.0.12051 运行它 -> 输出保持不变:pastebin.com/Ccm7acm9

标签: testing mono nunit monodevelop nunit-console


【解决方案1】:

它没有找到你的 nunit.framework.dll 文件,我认为你的安装很糟糕。你是如何安装单声道的?你是如何安装 NUnit 的?

虽然我建议先修复您的 mono/nunit 安装,但可能的解决方法是:

  1. 查找 nunit.framework.dll 的位置,例如:find /usr | grep nunit
  2. 以这种方式运行 nunit:

MONO_PATH=/path/where/nunit/dlls/are nunit-console4 Testsuite.dll

【讨论】:

  • 非常感谢,这成功了!我根本没有找到任何 nunit.framework.dll - mono 是由 Xamarin(以前称为 Mono Touch)安装的。也许这就是单声道安装不正确的原因。
  • 哦,我以为你在 Linux 中;然后在bugzilla.xamarin.com 中打开一个错误,他们会立即修复它,这样你就不再需要破解了
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-01-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-09-02
相关资源
最近更新 更多