0

我仍在为我的一些项目使用 Subsonic 2。想要破解它一点。我从 GIT 回购中获得了最新的信息,我正在使用 VS2008 Pro。

查看 SubSonic.Test 项目,引用的 mbUnit dll 具有“MbUnit.Framework 2.4.197”的描述,尽管文件版本是“1.0.2700.29885”。所以我假设我们正在使用 mbUnit 2.4。

我可以很好地编译项目,但我无法让 Gallio 识别 SubSonic.Tests\bin\Debug\SubSonic.Tests.dll 中的测试它只是提出“未找到测试”。

我花了几个小时试图在网上找到这种情况下的 docco,但实际上并没有。我也不热衷于修改现有项目,因为它与 GIT 起源进一步脱节。我已将魔术 GUIDS 粘贴到测试项目文件中。

   <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

TestDriven.Net 这样做:

------ Test started: Assembly: SubSonic.Tests.dll ------

Gallio TestDriven.Net Runner - Version 3.1 build 397

Test Files:
 C:\data\Subsonic\2_x\SubSonic-2.1\SubSonic.Tests\bin\Debug\SubSonic.Tests.dll

Start time: 5:02 PM
Verifying test files.
Initializing the test runner.
Running the tests.
Disposing the test runner.
Stop time: 5:02 PM (Total execution time: 1.752 seconds)

Test Report: file:///C:/Documents%20and%20Settings/User/Local%20Settings/Temp/Gallio/TDNetRunner/Report/SubSonic.Tests.dll.html
** NO TESTS WERE RUN (No tests found) **

我可以看到这是再次使用 Gallio;当然我不需要卸载 Gallio 吗?!我将它与 mbUnit 一起用于我当前的项目,效果很好。

两年前,我有这些单元测试像一只小猫一样发出咕噜咕噜的叫声,但我一生都记不起我是怎么做的。它现在是稍后的 VS 版本,我可能会在升级中丢失配置。我希望在那里找到可以进行 SubSonic v2.1 单元测试的人并问:你是如何运行测试的?

编辑:我最后联系了 Rob Conery,他确认(有些沮丧)TD .NET 不再运行 mbUnit 1 测试。他认为在 SubSonic 2 处于积极开发阶段时使用了 td.net 1.3,但我找不到该版本的任何历史下载。

这留下了我没有测试过的resharper。

如果我决定将测试框架升级到 mbUnit 3,那么我会将其发布到 GutHub。

感谢 Yann 的评论 - 我已选择您作为回答者。

更新:Subsonic 2 Github 资源在 2011 年 6 月左右升级到 mbUnit 3

4

1 回答 1

0

SubSonic.Tests is compiled against MbUnit v1.0. Gallio does not provide any support to such an old version of MbUnit. Please try replacing the MbUnit assembly (Dependencies\MbUnit.Framework.dll) by the latest compatible build. It should be v2.4.2. You will find it on the Gallio build server. Unfortunately, I'm not sure about the breaking changes between v1.0 and v2.4.

于 2011-01-10T09:14:33.613 回答