CI Factory with NUnit (rather than MbUnit)

I decided to add some unit tests into my first CI Factory project.  First I used a reference to MbUnit.Framework.dll in my test project, this is the unit test framework which ships with CI Factory, and all worked fine. 

No disrespect to MbUnit, but I decided I really wanted to use NUnit so I can utilise the larger amount of documentation and community knowledge that exists for NUnit (even though it might not be as flexible as MbUnit).  So I added NUnit 2.2.8 (.NET 2.0 version) underneath my CI Factory Third Party folder and flipped the test project over to use NUnit with a reference to NUnit.Framework.dll instead of MbUnit.Framework.dll.

Cruise Control blew up with an error in the NAnt Output log;

External Program Failed: C:\Program Files\NCover\NCover.Console.exe (return code was 1)

Oops!!  I know the issue is within the file Build/Packages/NCover/NCover.Target.xml, probably leading to Build/Packages/DotNetUnitTest/UnitTest.Target.xml but I couldn't find anything obvious to edit.

In the end the Solution was horribly simple and I let out a loud DOH!.  I just left the reference to MbUnit.Framework.dll in my test project, in addition to the NUnit.Framework.dll reference which actually performs the unit tests.

I can now run the NUnit GUI to run my tests on my development machine.  If they pass, I check in, Cruise Control builds the project and happily runs my unit tests in automated mode.

Happy, happy, joy, joy

P.S. I did muse that it could be the lack of an NUnit.Tasks.dll for NAnt to hook into which might be the issue, but I'm no expert so this is a bit of a wild stab in the dark.

Technorati tags: ,
Print | posted on Monday, April 16, 2007 12:24 AM

Feedback

# re: CI Factory with NUnit (rather than MbUnit)

left by Andy Stopford at 5/24/2007 8:34 AM Gravatar
Hi Liam,

I am lead on the MbUnit project so I am always interested in learning about why folks don't adopt MbUnit.

You can use MbUnit in the same way as NUnit, unless you wish to use the new assert syntax in NUnit 2.5 then MbUnit 2.4 and NUNit 2.4 can be used the same. The same asserts and fixtures etc.

MbUnit does have a far greater degree of testing ability so you can then make the switch to those features from an NUnit style as you wish.

MbUnit's community is growing each day, with active mailing lists and blogs for you to learn from and ask questions of. I agree the documentation needs work and this is on going but to unit test to the same degree as NUnit you don't need to learn anything new.

Andy

# re: CI Factory with NUnit (rather than MbUnit)

left by Liam Westley at 5/28/2007 11:13 PM Gravatar
As I mentioned - it was mainly the documentation issue. I work on a laptop quite a bit, with internet access not being guaranteed. Although the wiki is comprehensive, having off-line documentation (which NUnit has) is very useful. I suppose I could use the NUnit docs for MbUnit as they use the same basic syntax.

It's also probably lethargy. I've used NUnit previously (although only occasionally ) and I already had it installed and ready to go on my development PC. I was trying to get up to speed on CI Factory, and was keen to reuse any knowledge I already had.

I just had a peep at the MbUnit GUI and I'll resolve to have a better look at your framework in the future.

However, there is some sense of satisfaction in using two different unit testing frameworks. Currently my development PC runs tests using NUnit, the build server with MbUnit. That means two different frameworks performing the same unit tests which is even more 'thorough' than using a single testing framework. ;-)

Regards

Liam Westley

# NUnit Test Generator

left by Greg Finzer at 9/28/2007 4:43 AM Gravatar
Liam,

I recently created a tool to generate NUnit tests. I would like to get your opinion of it and also any suggestions for features. See the URL below.

http://www.kellermansoftware.com/p-30-nunit-test-generator.aspx

# re: CI Factory with NUnit (rather than MbUnit)

left by Hemal at 10/29/2008 12:19 PM Gravatar
Im facing the same problem. How did you manage to solve it?
Title  
Name
Email (never displayed)
Url
Comments   
Please add 6 and 6 and type the answer here: