## Running DBTestUnit tests using MBUnit

2011/06/08

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

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

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

GUI
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.
Console
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.

```

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.

/fc:CoreTests
Only run test fixtures categorised as ‘CoreTests’