How to have Pex generate NUnit, MbUnit and XUnit tests

By default, Pex will generate MSTEST tests, however that doesn’t mean you are constrained to using MSTEST for your project. The Pex Extensions project on CodePlex has a set of extensions which allows Pex to generate code for the three main test frameworks. I’ve just committed some changes to make the code work against the newly released Pex 0.6. In order to generate tests for a particular framework, you need to follow these instructions.

3) Pex will now start generating MbUnit v3 tests. A MbUnit extension is also included within the GallioMbUnit package.

Note: At the moment, you need to download the source code from codeplex and compile the binaries yourself, there is a single solution file which will build everything.

You also need to ensure both the extensions and your test project are built against the same version of the unit testing framework, otherwise there will be a type mismatch and Pex won’t be able to generate any tests.

4 thoughts on “How to have Pex generate NUnit, MbUnit and XUnit tests”

Pex would be able to generate 2.5 tests, however you will have to do some additional work. The Pex Extensions project will help. The binary releases are built against 2.4.8, however you can manually rebuild the project for 2.5 and then Pex will be able to generate code.