MbUnit / Gallio 上的 FixtureSetup 未運行 (FixtureSetup on MbUnit / Gallio doesn't run)


問題描述

MbUnit / Gallio 上的 FixtureSetup 未運行 (FixtureSetup on MbUnit / Gallio doesn't run)

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.

參考解法

方法 1:

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.

(by FredrikFrancis B.)

參考文件

  1. FixtureSetup on MbUnit / Gallio doesn't run (CC BY-SA 3.0/4.0)

#mbunit #gallio






相關問題

我可以圍繞 NUnit、MbUnit、xUnit 或其他測試框架創建一個包裝器嗎? (Can I create a wrapper around NUnit, MbUnit, xUnit or other testing framework?)

MbUnit / Gallio 上的 FixtureSetup 未運行 (FixtureSetup on MbUnit / Gallio doesn't run)

我可以使用我的 WatiN 測試來進行壓力測試嗎? (Can i use my WatiN tests to stresstest?)

Debug Unit Test bằng cách sử dụng Resharper 7 cho MBUnit ném ra một ngoại lệ (Debug Unit Tests using Resharper 7 for MBUnit throws an exception)

TestDriven.NET沒有運行我的MbUnit的SetUp方法 (TestDriven.NET is not running my SetUp methods for MbUnit)

Gallio用戶,您使用此工具有哪些優缺點? (Users of Gallio, what Advantages and Disadvantages have you experienced using this Tool?)

你知道任何關於 MBUnit 的教程嗎? (do you know any tutorial for MBUnit?)

MbUnit:比較雙打最優雅的方式? (MbUnit: The most elegant way to compare doubles?)

如何將 MBUnit 測試添加到 CruiseControl.Net 配置文件 (how to add MBUnit test to CruiseControl.Net config file)

MbUnit 回滾 (MbUnit Rollback)

使用 MbUnit3 的 [Rollback] 對 NHibernate 與 SQLite 的交互進行單元測試 (Using MbUnit3's [Rollback] for unit testing NHibernate interactions with SQLite)

MbUnit.framework.dll 可並行化屬性 (MbUnit.framework.dll Parallelizable attribute)







留言討論