Running DBTestUnit tests using MBUnit

The following gives a brief overview on how to use MBUnit (v using the GUI or console.

This version of MBUnit is the default testing framework up to version of DBTestUnit.

It assumes MBUnit has been installed to C:\Program Files\MbUnit\.

1. Open the GUI via: C:\Program Files\MbUnit\MbUnit.GUI.exe

2. Click on ‘Assemblies – Add Assemblies’

Browse to location of the the database unit test dll to be tested.

eg for AdventureWorks – the example database used in previous blogs – browse to:


3. The following image shows what the GUI looks like:

To run the tests simply click the ‘Run’ button.

Individual tests or groups of tests can be run by selecting various nodes on the hierarchy on the left hand side.
1. The console can be run via: C:\Program Files\MbUnit\MbUnit.Cons.exe.

2. The following sample bat script could be used to run all the sample AdventureWorks database unit tests.

SET testDll=C:\Projects\AdventureWorks\src\AdventureWorksDatabaseTest\bin\Debug\AdventureWorks.DatabaseTest.dll

cd C:\Program Files\MbUnit\

MbUnit.Cons.exe %testDll% /v

3. The following examples show a number of different switches that can be used to limit the set of tests to run.

Only run test fixtures categorised as ‘CoreTests’

Only run test fixtures in this namespace.

Only run this individual test fixture.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: