O'Reilly logo

NUnit Pocket Reference by Bill Hamilton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Compatibility

This section describes how to run tests created in older versions of NUnit using NUnit 2.2 and highlights the most significant changes made in the last two releases of NUnit.

Using NUnit 2.1 Tests with NUnit 2.2

To run NUnit 2.1 tests with NUnit 2.2, recompile the tests using the NUnit 2.2 nunit.framework assembly. You might also need to add a reference to the nunit.core assembly if you are using core types.

Using NUnit 2.0 Tests with NUnit 2.2

There are two options for running NUnit 2.0 tests with NUnit 2.2. The first option is to upgrade the 2.0 tests and recompile the test assemblies using the new nunit.framework assembly.

Tip

The NUnit 2.2 documentation states that the Assertion class is deprecated and marked obsolete. Although not necessary, you might want to convert all assertions to use the new Assert class to ensure compatibility with future versions of NUnit.

The second option allows you to run NUnit 2.0 tests with NUnit 2.2 without changing the NUnit 2.0 tests. Create the appropriate binding redirect in the test runner configuration file (nunit-gui.exe.config or nunit-console.exe.config). The nunit20under21.config file in the src subdirectory of the NUnit 2.2 installation directory has the required redirect in the bindingRedirect element and can be used as is or as a template.

Upgrading from NUnit 1.x to 2.2

You cannot run NUnit 1.x tests using NUnit 2.2—the only option is to upgrade the Version 1.x tests. The following points outline the changes you must make to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required