Legacy Documentation. View NUnit 3 Documentation

Release Notes

NUnit 2.4 Final Release (2.4.0.2) - March 16, 2007

Gui

  • A new /cleanup commandline option deletes NUnit's shadow copy cache and then exits.
  • When NUnit is run under .Net 1.1, assemblies built with .Net 2.0 are not displayed in the recent files list. NUnit automatically loads the last assembly that was opened under .Net 1.1.

    Note: When a program built with .Net 1.1 is run under .Net 2.0, it will not appear in the Recent Files list the next time NUnit is run under .Net 1.1. This issue will be fixed in a future release.
  • When the NUnit documentation is not installed, the Help menu item now displays the NUnit web site.

Bug Fixes

  • The user interface (NUnitForm.cs) was not properly displayed at design time due to a problem with detecting DesignMode in nested User Controls.
  • CollectionConstraint was failing to find contained items in a collection implementing ICollection only - that is not implementing IList. This is now fixed and all collections use the same code path to avoid future problems.
  • The Tree setting "Show Checkboxes" was not being saved properly.
  • Many of NUnit's own tests were leaving files in the shadow copy cache due to not closing the test domain.
  • NUnit was attempting to instantiate an abstract class, derived from another abstract class marked with TestFixtureAttribute. NUnit will now mark all abstract classes with this attribute, or inheriting from classes with this attribute as non-runnable.

NUnit 2.4 RC2 (2.4.0.1) - March 9, 2007

Framework

  • The Is class has been moved to the SyntaxHelpers namespace in order to eliminate conflicts with mock object frameworks. Additional helper classes List, Has and Text have been added.
  • The AssertionHelper class has been added as an optional base class for user fixtures. Use of this class as a base makes methods available for creating constraints needing to use one of the helper classes.
  • A PropertyConstraint has been added, which allows testing the value of one of an object's properties.

NUnit 2.4 RC1 (2.4.0) - February 25, 2007

General

  • Two packages, built under the 1.1 and 2.0 runtimes, are provided as before, but they are now mutually exclusive - only one may be installed. By downloading the source, you can rebuild NUnit under other runtimes. See the Platform Support page for details about the runtimes under which each each package may be run.
  • If you build NUnit from source, you will notice that the full text of the license is no longer included in every file. For easier maintenance, we now put a short notice in the source files, which refers to the license.
  • Fit tests are now provided. The tests supplied are fairly rudimentary, but it's a start! The Fit assemblies required to run the tests are included with the NUnit distribution. You can get a complete Fit download, including source code, at the Fit website.
  • Samples are now organized by language and additional samples have been provided. C++ samples are provided using both the VS2003 managed C++ syntax and the new C++/CLI syntax for VS2005. Solution files group samples by language, with an additional solution for extensibility samples.
  • The nunit.common assembly, added in the Alpha release, has been eliminated.

Framework

  • A new syntax and internal architecture for Asserts is being introduced in this release, based on the notion of constraints found in JMock and NMock.
    • The Assert.That method is used to make an assertion based on a constraint
      Assert.That( actual, constraint, message, args );
      Assert.That( actual, constraint, message );
      Assert.That( actual, constraint );
    • The constraint argument may be specified directly using one of the built-in constraint classes or a user-defined class.
    • It may also be specified using one of the syntax helpers provided as static methods of the Is class, such as
      Is.Null
      Is.Empty
      Is.EqualTo( object )
      Is.CollectionContaining( object )
      Is.SubsetOf( collection )
      See the docs for complete information.
    • Internally, all the "classic" Assert methods, like AreEqual, have been re-implemented using the underlying constraint architecture.
    • The old approach to extending Asserts by creating Asserter classes is now deprecated and the classes and interfaces are marked Obsolete.
  • A number of changes have been made to the ExpectedException attribute
    • Several constructors for ExpectedExceptionAttribute have been removed and two are now marked obsolete. All functionality continues to be available through the use of named parameters. See the documentation for details.
    • User-defined ExceptionHandlers are now supported:
      • A handler takes a System.Exception as an argument and returns void. Normal Assert statements are used to validate the exception.
      • A default handler may be specified for the fixture by implementing the IExpectException interface.
      • Individual test case handlers may be specified by use of the Handler named parameter.
      • The ExpectedException attribute may be used without an exception type, leaving all validation to the ExceptionHandler.
    • A custom error message may be displayed by use of the UserMessage named parameter.
  • The StringAssert class has a new IsMatch method that does regular expression matching.
  • The setup and teardown methods in a SetUpFixture are now marked by the SetUpAttribute and TearDownAttribute rather than the corresponding "Fixture" attributes used in earlier betas.
  • NUnit now recognizes user-defined attributes derived from CategoryAttribute and PropertyAttribute. Protected constructors are provided for use by derived classes:
    protected CategoryAttribute()
    Creates a category with the same name as the derived class.
    protected PropertyAttribute(object attributeValue)
    Creates a property with the same name as the derived class.

    Note: Other attributes remain sealed, as in prior releases.

Core

  • User settings are now stored in an XML file rather than the registry. Any existing settings from NUnit 2.2 or from earlier betas are migrated on first use.
  • Properties assigned to tests are now included in the XML output file.
  • Internally, many classes which were previously defined as singletons are now treated as services, managed by a ServiceManager.

Console

  • The new /domain option controls of the creation of AppDomains for running tests. The following values are recognized:
    None
    No domain is created - the tests are run in the primary domain. This normally requires copying the NUnit assemblies into the same directory as your tests.
    Single
    A test domain is created - this is how NUnit worked prior to version 2.4
    Multiple
    A separate test domain is created for each assembly
    The default is to use multiple domains if multiple assemblies are listed on the command line. Otherwise a single domain is used.

  • The obsolete /thread option has been replaced by /nothread. Since tests have been run on a separate thread by default for some time, the old option had no effect.

    Note: Default use of a separate test thread is intended to isolate NUnit from changes made to the thread context. Tests that change the context and don't restore it should not be run using this option.

Gui

  • The GUI command line now supports /include and /exclude options for categories. Only one of the two may be used at a time. These options effect the initial category selection in the GUI.
  • The XML test results are now saved automatically in file TestResult.xml at the end of each run.
  • An option is provided to suppress shadow-copying of assemblies.
  • The Test Properties dialog now displays properties assigned to a test. The text fields for categories and properties have been replaced with listboxes.
  • Trace output from tests is displayed in a tab in the GUI. Optionally, trace and stderr output may be redirected to the Console output tab
  • The position, size and font of the mini-Gui window are now saved separately from the full-size window.
  • Internally, the gui display has been refactored so so that the tab display is provided by a separate control.
  • The Windows install packages set up individual shortcuts for running under each of the supported runtimes installed on your system. If additional supported runtimes are installed, you can create similar shortcuts yourself or reinstall NUnit to have them created automatically.

NUnit 2.4 Beta 2 Release (2.3.6293) - October 20, 2006

General

  • A new assembly, nunit.core.interfaces, is being introduced in this release. This assembly holds interfaces, enumerations and data types that are intended for external use - for example, by client code that executes NUnit tests. Our intent is to hold the version number of this assembly constant through all NUnit 2.4 maintenance releases and to avoid any breaking changes in this code.
  • The Windows installer is now built using WiX. With the removal of the Visual Studio deployment project from the VS2005 solution, it is now possible to build NUnit completely using C# Express.
  • The nunit.framework assembly is no longer installed in the GAC.

Framework

  • The AreEqual and AreNotEqual asserts have been enhanced to work with multi-dimensional arrays and jagged arrays.
  • The error message for AreEqual with doubles and floats now includes the tolerance that was used in the comparison.
  • The handling of categories was not being done correctly. This is now fixed.

Console

  • The '/' character is no longer accepted for command-line options under Linux. Any argument beginning with '/' is taken as a path.
  • Fixed bug causing the /include and /exclude parameters to be ignored.

Gui

  • Added a dialog to the Tools menu for displaying installed NUnit add-ins.
  • Modified the Tree submenu of the View menu to simplify choices for expanding and collapsing the tree.
  • Added an entry to the View menu for displaying info about loaded test assemblies.
  • Added Run All, Run Failed, Show CheckBoxes, Expand All and Collapse All items to the tree context menu.
  • When right-clicking in the tree below the lowest node, the context menu commands now relate to the currently selected node or nodes rather than the last node the user right-clicked on.
  • The '/' character is no longer accepted for command-line options under Linux. Any argument beginning with '/' is taken as a path.
  • The category list is now cleared when a project is closed.
  • The "Word Wrap" checkbox has been removed. The setting is now available on the Options Dialog.
  • Automatic rerun of tests on change now works correctly.

Extensibility

  • The extensibility mechanism has been generalized to allow a wider range of future extension points. The following new attributes and interfaces are used:
    NUnitAddinAttribute
    Used to mark all addins and optionally specify Type, Name and Description
    ExtensionType
    Indicates whether the addin provides Core, Client or Gui extensions.
    IAddin
    Interface implemented by all addins, which allows the addin to install itself.
    IExtensionHost
    Interface supported by each NUnit extension host. Each host provides a number of extension points. This release provides only the Core extension host. Future releases will provide Client and Gui hosts.
    IExtensionPoint
    Interface supported by an extension point, allowing an addin to install and remove the extensions it provides.
    IFrameworkRegistry
    Interface allowing addins that support external test frameworks to register them with NUnit.

NUnit 2.4 Beta 1 Release (2.3.6162) - June 11, 2006

General

  • Additional NUnit tests now pass under Linux. Those that do not have been excluded using the Platform attribute.

Framework

  • Added a Reason property to ExplicitAttribute, for use in explaining why a test is marked Explicit.
  • Multiple SetUp or TearDown methods now give a more meaningful error message.

Console

  • The console now outputs test failures to Trace all the time, not just when running under the debugger. You will see clickable trace output in Visual Studio even if you use the Start Without Debugging menu item.

Gui

  • Added Test Menu with entries for running the selected test, all tests or failed tests.
  • Instead of displaying a dialog box, unhandled exceptions now display in the Errors & Failures tab, with an indication of the test that was running when the exception was thrown. The test itself is not shown as a failure, (unless it failed for some other reason, since it may not have caused the exception. The progress bar turns red if any unhandled exceptions are thrown.
  • The GUI no longer crashes when reloading assemblies with added or deleted tests.

NUnit 2.4 Alpha Release (2.3.6142) - May 22, 2006

General

  • The source code directory structure has been reorganized to separate NUnitFramework and NUnitCore.
  • A new nunit.common assembly isolates core interfaces.
  • The following assemblies are now strongly named: nunit.mocks, nunit.core.extensions and nunit.framework.extensions
  • NUnit may now be installed by non-administrators, subject to any security restrictions imposed by the particular site.
  • The .Net 2.0 builds of NUnit are now called "NUnit for .Net 2.0"
  • The NAnt build script has been simplified and now consists only of the nunit.build and nunit.build.include files.
  • The NAnt build script now has a target for building under the Mono 2.0 profile.
  • NUnit is now been built and tested using both Microsoft .Net (1.0, 1.1, 2.0) and Mono (1.0 and 2.0 profiles).

    Note: in the Alpha release, a number of tests are skipped when running under Linux or Unix.

Framework

  • A new CollectionAssert class has been added. It supports the following methods:
    AllItemsAreInstancesOf
    Tests that all members of a collection are instances of a class
    AllItemsAreNotNull
    Tests that all collection members are non-null.
    AllItemsAreUnique
    Tests that all collection members are unique
    AreEqual / AreNotEqual
    Test whether two collections are equal, having the same members in the same order
    AreEquivalent / AreNotEquivalent
    Test whether two collections are equivalent, having the same members without regard to order
    Contains / DoesNotContain
    Test whether a collection contains a particular object
    IsSubsetOf / IsNotSubsetOf
    Test whether one collection is a subset of another
    IsEmpty / IsNotEmpty
    Test whether a collection is empty or not

    Note: In the Alpha release, IsEmpty, IsNotEmpty and Contains also continue to be available in the Assert class. We will be seeking feedback to determine whether these methods should be removed.

  • A new FileAssert class has been added. It supports the following methods:
    AreEqual( Stream, Stream )
    AreEqual( FileInfo, FileInfo )
    AreEqual( string, string )
    AreNotEqual( Stream, Stream )
    AreNotEqual( FileInfo, FileInfo )
    AreNotEqual( string, string )
  • The following new methods have been added to the Assert Class:
    Assert.GreaterOrEqual()
    Assert.LessOrEqual()
  • The following new overloads have been added to the Assert class:
    Assert.AreEqual( long, long )
    Assert.AreEqual( ulong, ulong )
    Assert.AreNotEqual( long, long )
    Assert.AreNotEqual( ulong, ulong )
  • The following Asserts have been re-implemented in terms of AreEqual and AreNotEqual in order to provide clearer messages when they fail:
    IsTrue / IsFalse
    IsNull / IsNotNull
    IsNaN
    IsEmpty / IsNotEmpty (string only)
  • A new PropertyAttribute allows setting arbitrary named properties on test cases and fixtures. NUnit makes no use of these properties but they may be accessed from the tests via reflection.
  • ExpectedExceptionAttribute now takes an optional third argument to specify how the expected message should be matched. In addition to an exact match, as now, you may specify a string which should be contained in the message or a regular expression to be matched against the actual message.

Core

  • When multiple assemblies are loaded, they may use a single AppDomain, as now, or a separate AppDomain for each assembly. The new option provides greater isolation of the tests and allows use of separate config files for each assembly.

    Note: In the Alpha release, separate config files are required when this option is used, even if an NUnit project is loaded.
  • The automatic creation of test suites for each namespace is now optional. When the creation of these suites is suppressed, the fixtures are loaded as a simple flat list, without any hierarchy imposed.
  • When multiple assemblies are loaded, the tests may optionally be merged. If automatic namespace suites are enabled, namespaces are merged across assemblies. This option is only available if a single AppDomain is used.
  • The fixture object is created for the life of the test run and is no longer reused on subsequent runs. If the object implements IDisposable, Dispose is called before destroying it.
  • The current directory is set to the location of the test assembly before running each fixture. This change facilitates running fixtures in any order and eliminates interference between fixtures that change the current directory.
  • Non-public fixture classes are treated as non-runnable and display a warning message rather than being silently ignored.
  • A new SetUpFixture allows one-time SetUp and TearDown at the level of a NameSpace or for an entire assembly.

  • The TestRunner no longer passes "live" tests back to the gui or console. Instead, a data class that encapsulates the info about the test is sent.
  • Registry settings are now stored under nunit.org. Old settings are migrated automatically when the application is first run.
  • When the default config for a test project is set to "NUnitAutoConfig" the configuration of the current NUnit build is automatically selected for the tests, if available. This is intended for use by NUnit developers.

Console

  • When multiple assemblies are passed on the command line, the console runner now loads those assemblies into separate AppDomains. Separate config files should be provided for each assembly in this case.
  • The /include and /exclude> options may now be combined on the command line. When both are used, all tests with the included categories are run except for those with the excluded categories.

Gui

  • The gui executable is now called "nunit.exe" rather than "nunit-gui.exe"
  • There is a new option to automatically re-run the test whenever a change is detected.
  • A new "mini-gui" configuration may be selected from the View menu. This display consists of the tree view area only. All info about the tests may be accessed via the properties display or by returning to the full gui.
  • The following additional Gui customizations are also available through the View menu:
    • The font used in the Gui may be changed
    • The four info tabs on the right may be turned on or off
    • The status bar may be removed
  • Menu items pertaining to expansion and collapse of the tree have been moved to the Tree submenu of the View menu.
  • The Options dialog has been reorganized to add new options for running tests and to better group similar items.
  • The Test Properties dialog has been reorganized to display all info on a single page and to more clearly show the status of the test.
  • The icons used for tests in the tree view now show test status by use of symbols, in addition to their color:
    Not Run
    Grey circle
    Success
    Green circle with a check mark in it
    Failure
    Red circle with an X mark in it
    Ignored
    Yellow circle with a question mark in it
  • For further customization of the icons, users may modify or replace the files Success.jpg, Failure.jpg or Ignored.jpg in the NUnit bin directory.
  • Tests that are not run due to the Explicit or Platform attributes are no longer considered as Ignored. They remain marked as grey in the gui and do not affect the color of the progress bar.
  • Wordwrap may be turned on and off in the 'Errors and Failures' tab by use of a checkbox at the bottom of the tab.

Extensibility

  • NUnit now supports three types of core addins:
    SuiteBuilders
    Allow an extender to provide new types of test fixtures with their own behavior.
    TestCaseBuilders
    Allow an extender to provide new types of test cases, either as a part of a custom test fixture or within a standard NUnit fixture.
    TestDecorators
    Allow an extender to modify the behavior of a standard or custom test case or fixture. This is a good choice for implementing attributes that should apply to various types of tests.
  • Addin assemblies may now be deployed by copying them assembly to the NUnit bin/addins directory.
  • Extensions distributed as part of NUnit are now divided between the two assemblies nunit.core.extensions and nunit.framework.extensions. Only the latter is intended to be referenced by user tests.
  • This Alpha release of NUnit provides only one internal extension: the Repeat attribute may be applied to test cases to cause them to run a number of times. The extensions emulating CsUnit and VSTS tests, which were included experimentally in recent versions of NUnit 2.2 have been removed and will be distributed separately.
  • Several trivial examples, which were formerly part of the extensions assmebly are now included as samples.
  • Documentation for NUnit's extensibility features is still in preparation.

Earlier Releases

Cumulative notes through NUnit 2.2.10 are available here