MbUnit (2.16.1) has now the ability to load and run NUnit (and csUnit) assemblies without recompilation.
How it works
Jamie Cansdale (NUnitAddin) sent me some classes he was using in his Addin to execute NUnit assemblies. Thank you Jamie :). When a type is explored, it looks into the referenced assemblies for NUnit.Framework.dll or csUnit.Framework.dll. If found, it thens extracts the TestFixtureAttribute type and tests if the type is tagged with it. A couple more details and there you have NUnit tests run by MbUnit...
Sample:
The following sample fixture is a standard NUnit fixture:
using System; using NUnit.Framework; namespace MbUnit.Tests.Core.FrameworkBridges { [TestFixture] public class NUnitFrameworkTest { [TestFixtureSetUp] public void TestFixtureSetUp() { Console.WriteLine("TestFixtureSetUp"); } [SetUp] public void SetUp() { Console.WriteLine("SetUp"); } [Test] public void Test() { Console.WriteLine("Test"); } [Test] public void AnotherTest() { Console.WriteLine("Another test"); } [Test] [ExpectedException(typeof(AssertionException))] public void ExpectedException() { Assert.Fail("Should be intercepted"); } [Test] [Ignore("Testing ignore")] public void Ignored() { Assert.Fail("Must be ignored"); } [TearDown] public void TearDown() { Console.WriteLine("TearDown"); } [TestFixtureTearDown] public void TestFixtureTearDown() { Console.WriteLine("TestFixtureTearDown"); } } }
The fixture is loaded and executed by MbUnit and the reports shows:
Page rendered at Monday, October 13, 2008 11:45:10 AM UTC
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.