使用MbUnit与Delphi Prism

3
我已经在Delphi Prism中创建了下面的简单测试用例。当我使用Gallio Icarus运行测试用例时,它返回一个此测试不受任何可用测试框架支持
我只能想到两个可能的原因:
  • 我可能错过了一些(非常)明显的东西。设置、某个地方缺少初始化...
  • 不可能使用MbUnit - Gallio组合与Delphi Prism
我希望这是因为我错过了一些明显的东西。如果不是这样,请问其他人在使用Delphi Prism时使用什么测试框架呢?
namespace MailExtensionTests;

interface

uses
  MbUnit.Framework;

type
  Class1 = public class
  public
    [Test]
    procedure TestSomething;
  end;

implementation

procedure Class1.TestSomething;
begin
  Assert.IsTrue(True);
end;

end.
1个回答

2

I am not well versed in the .Net landscape of things, at least I've learned that much.

I know now that I had given way to little information about what versions I used to be able to answer the question.

 - Windows XP 5.1.2600.
 - VMWware 6.5.4 with 2Gb of memory.
 - Delphi Prism running in Visual studio 2010.
 - .Net Framework 4
 - Gallio 3.1
 - MbUnit 3.1

Now that I have been able to solve the problem created by yours truly, these are two solutions that worked for me.

First solution

One thing I neglected to mention whas the .Net framework I was compiling against.

Our aim should always be to go for the higest, the fastest, the bleeding edge kind of thing right? As such, it was a no-brainer for me to choose .Net Framework 4 as my Target Framework to compile against. I mean, the highest, the best, the meanest... What could possibly be wrong with that.

Well for starters, Gallio version 3.1 doesn't support .Net Framework 4. It would have taken me a mere look at the home page of MbUnit to figure that one out. But who reads that stuff anyway, right? Surely, not some hardcore developers like myself. You never know who might be looking over your shoulder, catches you reading documentation and your reputation goes right down the drain.

After I finally made peace with myself there was no way arround it than actually trying to read some documentation, I was able to compile a version that ran in Gallio 3.1. Hooray, mission accomplished... or so I thought.

Running that one, really simple testcase took about half a minute, every time, all the time. That surely couldn't be right?! Luckily, this problem was already mentioned here and here what brings us to

Final Solution

As been mentioned in the slow Gallio posts, one way to solve them was to install the latest, unofficial, version of Gallio. Talk about bleeding edge, this is it. I felt my heart pounding in my chest, adrenaline pumped up and it took me some serious constraint not to shout it out.

A link to all latest versions of Gallio, one download, one install and some reattaching of references was all it took. I was finally able to run my testcase not only in .Net framework 3.5 but also in .Net framework 4.0.

Oh yeah, eat that baby. Who's the man now... who's the man (relax Lieven, breath... breath...)

Final thoughts

It has been an interesting journey for me to say the least. I have regained some of my lost humility.
Those of you who haven't dozed of to sleep by now, you have my respect.


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