MbUnit / Gallio 上的 FixtureSetup 无法运行

发布于 2024-07-25 23:17:52 字数 930 浏览 5 评论 0原文

我不明白这个问题。 首先,我引用了 MBUnit v2,一切都运行良好。 然后我安装并引用了MBunit v3...这似乎是Gallio安装bin文件夹中的MbUnit.dll和Gallio.dll。 当我编译时,我收到了一些关于 TestFixtureSetup 的警告,所以我将它们更改为 FixtureSetup。 但现在他们不再被处决了。 有什么线索我做错了吗?

顺便说一句,我应该引用哪个 dll? 因为当我使用 MbUnit v2 时,我总是使用 MbUnit.Framework.dll,但情况似乎不再如此了。

我很困惑...

编辑: 我认为这个例子最好地解释了我的问题:

我使用 TestDriven.NET 尝试了这个:

[TestFixture]
    public class CategoryTests 
    {
        [FixtureSetUp]
        public void _TestFixtureSetup()
        {
            Debug.WriteLine("in fixturesetup");
        }

        [Test]
        public void test()
        {
            Debug.WriteLine("in test");
            Assert.IsTrue(true);
        }
}

右键单击测试方法并选择运行测试后,我得到以下输出:

------ Test started: Assembly: mvcstore.DataAccess.Tests.dll ------

in test

1 passed, 0 failed, 0 skipped, took 1.13 seconds.

I don't understand this problem. First I had MBUnit v2 referenced and everything worked perfectly. Then I installed and referenced MBunit v3... Which seems to be MbUnit.dll and Gallio.dll in the Gallio install bin-folder. And when I compiled I got some warnings on TestFixtureSetup, so I changed those to FixtureSetup. But now they don't get executed anymore. Any clues what I'm doing wrong?

Which dll's should I reference btw? Because when I used v2 of MbUnit I always used MbUnit.Framework.dll but that doesn't seem to be the case anymore.

I'am confused...

Edit:
This example explains my problem best I think:

I tried this using TestDriven.NET:

[TestFixture]
    public class CategoryTests 
    {
        [FixtureSetUp]
        public void _TestFixtureSetup()
        {
            Debug.WriteLine("in fixturesetup");
        }

        [Test]
        public void test()
        {
            Debug.WriteLine("in test");
            Assert.IsTrue(true);
        }
}

Upon rightclicking on the test method and choosing Run Test(s) I get this output:

------ Test started: Assembly: mvcstore.DataAccess.Tests.dll ------

in test

1 passed, 0 failed, 0 skipped, took 1.13 seconds.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

虐人心 2024-08-01 23:17:52

您只需要以下 2 个程序集:MbUnit.dll 和 Gallio.dll。 请务必使用新的运行程序,因为旧的运行程序 (mbunit v2) 与 mbUnit v3 不兼容。

Icarus 是 GUI 运行器,Echo 是命令行运行器。

You need only the 2 following assemblies: MbUnit.dll and Gallio.dll. Be sure to use the new runner because the old one (mbunit v2) is not compatible with mbUnit v3.

Icarus is the GUI runner and Echo is the command line runner.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文