## Release Notes

View Combined 2.6 Changes

### NUnit 2.6 Final Release - Version 2.6.0.12051 - February 20, 2012

#### Bug Fixes

- 881715 Frequent socketexception in nUnit GUI
- 881958 nunit-console-x86 crashes with socketexception
- 928018 Issue with test time print out
- 930774 Adding or Removing a category in the Gui causes an exception
- 933800 NUnit will crash when started and dll from previous project doesn't compile

### NUnit 2.6 Release Candidate - Version 2.6.0.12035 - February 4, 2012

#### General

- The Windows installer is now built using WiX 3.5, upgraded from 2.0.

#### Framework

- The API used to create Action Attributes has been changed from the earlier beta releases. See the docs for more info.
- Visual Basic users may now use Assert.ByVal rather than Assert.That() to avoid errors when the first argument is a property with a non-public setter.
- PlatformAttribute now supports arguments 'Windows8' and 'Windows2012Server'.

#### Bug Fixes

- 498659 Registry entries and shortcuts remain after install
- 498690 Assert.That() doesn't like properties with scoped setters
- 638289 Install uses CURRENT_USER instead of LOCAL_MACHINE for AssemblyFoldersEx
- 910189 Eliminate NUnit Configuration Section in config file
- 919876 NUnit.Util.Transform.resources missing from nunit.util.dll
- 920472 CollectionAssert.IsNotEmpty must dispose Enumerator
- 922455 Add Support for Windows 8 and Windows 2012 Server to PlatformAttribute
- 924504 NUnit project files should have an Edit command association with the project editor

### NUnit 2.6 Beta 4 - Version 2.6.0.12017 - January 17, 2012

#### General

- NUnit no longer stores settings in the test configuration file, as it did in earlier versions. Specifically, we no longer recognize or support OldStyleTestCases, ApartmentState, ThreadPriority or DefaultLogThreshold in the configuration file. Further details on each of these features are included in the appropriate sections below.
- The TestRunner interface has been modified. Applications using this interface will need to be modified but general users are not effected.
- The build now uses the NAnt 0.91 final release.

#### Framework

- User-defined equality comparers specified with the Using syntax element may now be used with arrays and dictionaries. Essentially, this means that there are no longer any restrictions on the Types for which a user-defined equality comparer may be specified.
- So-called "old-style" tests, identified by having a name beginning with "Test" are no longer supported in NUnit 2.6.
- Setting a ThreadPriority for the test runner thread is no longer supported under NUnit 2.6.

#### Console

- The following new command-line options are provided:
  - -stoponerror causes execution of the test run to terminate immediately on the first test failure or error.
  - -apartment is used to specify the ApartmentState (STA or MTA) of the test runner thread. Since the default is MTA, the option is only needed to force execution in the Single Threaded Apartment.

#### Gui

- A number of new settings are available using the Settings Dialog:
  - The Tree Display page allows the user to select alternate image sets for use in the test tree. Additional user-provided image sets may be added if desired.
  - The Text Output page allows setting the threshold for capture and display of log4net output (previously controlled by the test config file).
- By default, test Cases under a Theory that fail an assumption are no longer shown in the tree. A context menu item has been added to allow the user to view them.
- The properties dialog has been redesigned to be more compact and readable.
- The context menu for the test tree has been simplified.

#### Bug Fixes

- 605034 Log4net not working with NUnit
- 708173 NUnit's logic for comparing arrays - use Comparer<T[]> if it is provided
- 719184 Platformdependency in src/ClientUtilities/util/Services/DomainManager.cs:40
- 761579 Tests using log4net run very slowly
- 848713 Feature request: Add switch for console to break on any test case error
- 882192 Ignored test icon should be more prominent
- 885173 Tests are still executed after cancellation by user
- 896615 Tests can't be run in existing AppDomain
- 897289 Is.Empty constraint has unclear failure message
- 899178 Wrong failure message for parameterized tests that expect exceptions
- 902305 Gui should not normally display Inconclusive test cases for a Theory
- 902343 Gui 'Hide Tests' function no longer works
- 903078 DomainUsage.None setting crashes nunit-gui
- 903080 Test tree context menu needs to be simplified
- 904841 After exiting for timeout the teardown method is not executed
- 907270 Gui enables run when the assembly specified on the command line is not found
- 908829 TestCase attribute does not play well with variadic test functions
- 910218 NUnit should add a trailing separator to the ApplicationBase
- 912955 Project files missing in source code package

### NUnit 2.6 Beta 3 - Version 2.6.0.11340 - December 6, 2011

#### Framework

- The Constraint syntax now supports Is.Positive, which is interpreted as greater than zero, and Is.Negative, which is interpreted as less than zero.

#### Bug Fixes

- 892844 Not using Mono 4.0 profile under Windows
- 892845 "Mono" is not clearly shown in About box or Test Assemblies dialog
- 892847 Gui offers to load assemblies under a lower CLR version
- 893919 DelayedConstraint fails polling properties on references which are initially null
- 893991 When working directory contains # sign, it is truncated
- 898192 Feature Request: Is.Negative, Is.Positive
- 898256 IEnumerable for Datapoints doesn't work
- 898850 NUnit 2.6 beta 2 crashes on assemblies without tests

### NUnit 2.6 Beta 2 - Version 2.6.0.11324 - November 20, 2011

#### General

- NUnit's executables now use config files that allow smoother running of mixed assemblies built for .NET 2.0 under .NET 4.0.
- When opening Visual Studio formatted solutions, NUnit now uses the solution configuration by default, resulting in changed behavior from previous releases. The Settings Dialog may be used to revert NUnit to the earlier behavior, which ignored solution configurations.
- Changing the URL to be used for NUnit help through the config file is no longer supported.

#### Framework

- TestCaseAttribute now accepts Explicit and Reason named parameters.
- TestCaseSourceAttribute now accepts a Category named parameter.
- TestCaseData now supports marking individual test cases as Explicit.
- EqualConstraint now recognizes and uses IEquatable<T> if it is implemented on either the actual or the expected value. The interface is used in preference to any override of Object.Equals(), so long as the other argument is of Type T. Note that this applies to all equality tests performed by NUnit.
- When Assert.Throws() fails due to an exception of the wrong Type being thrown, the error message now includes the Message and Stack Trace from the exception.
- The constraint syntax now supports Has.Exactly(n)... in place of Has.Some... in order to allow tests over collections that must be satisfied a specific number of times.
- The Using(...) syntactic element may now be repeated multiple times in an expression, so long as each comparer applies to a different Type. NUnit will use the appropriate comparer, depending on the Type of the arguments. Among other things, this allows overriding the default NUnit comparison of collections.
- Documentation is provided for the previously undocumented TestContext. A new property TestContext.WorkDirectory allows tests to access the name of a directory to be used for file output. This directory may be specified by use of the /work option of nunit-console.

#### Gui

- The test reload functionality in the Gui has been rewritten and simplified so that the same logic is used for all cases where the visual state of the tree is to be recovered. Test results are now found even if changes to the assembly have resulted in the assignment of new ids to the tests.
- The Gui now displays invalid tests in red immediately upon load, without waiting for the user to run them. Tests marked with the IgnoreAttribute are displayed in yellow immediately as well.
- The directory containing the log files may be opened directly from the Gui by use of a new item on the Tools menu.
- Test summary results are truncated when the window size is too small. The full summary is displayed when hovering over the field.
- A number of new settings are available using the Settings Dialog:
  - The Project Editor page allows the user to select whether the NUnit Project Editor or another external program will be used when editing the settings file.
  - The Runtime Selection page allows enabling or disabling automatic detection of the target runtime for each test assembly.
  - The Advanced Loader Settings page now allows specifying the argument to use in calling SetPrincipalPolicy for each test AppDomain.
  - The Visual Studio page now includes a setting that enables or disables the use of solution configs when loading Visual Studio solution files.
  - The Internal Trace page now shows the directory path to which log files will be saved.
- The location of the settings dialog under the Windows AppData directory has been changed from Roaming to Local. Users will need to reset their preferences in some cases.

#### Bug Fixes

- 602761 nunit-agent hangs after tests complete
- 625672 NUnit GUI bounces to background on reload
- 657801 Help URL should not be in config file
- 676560 Assert.AreEqual does not support IEquatable<T>
- 697069 Feature request: dynamic location for TestResult.xml
- 697329 NUnit tries to test disabled projects
- 709062 "System.ArgumentException : Cannot compare" when the element is a list
- 712156 Tests cannot use AppDomain.SetPrincipalPolicy
- 766749 net-2.0\nunit-console-x86.exe.config should have a startup element and also enable loadFromRemoteSources
- 770471 Assert.IsEmpty does not support IEnumerable
- 785460 Add Category parameter to TestCaseSourceAttribute
- 794115 HashSet incorrectly reported
- 800089 Assert.Throws() hides details of inner AssertionException
- 836080 Log Directory shown incorrectly in settings dialog
- 836360 When size of the Gui window is reduced, test result info may not fit in the field provided
- 841894 UI won't run tests marked Explicit from the context menu
- 878376 Add 'Exactly(n)' to the NUnit constraint syntax
- 878899 Changing logging level has no effect until NUnit is restarted
- 878955 ParameterizedTest not in their parent test-suite when FixtureSetup fails in .xml result file
- 881617 Tests with invalid category attributes should be more visible
- 882137 When no tests are run, higher level suites display as Inconclusive
- 882517 NUnit 2.5.10 doesn't recognize TestFixture if there are only TestCaseSource inside
- 883271 Reload Tests sometimes "loses" tests
- 885277 Exception when project calls for a runtime using only 2 digits
- 885604 Feature request: Explicit named parameter to TestCaseAttribute
- 887005 NUnit.exe ignores categories when using /run option
- 890129 DelayedConstraint doesn't appear to poll properties of objects
- 890384 When font is enlarged, layout of settings pages is incorrect
- 891237 When font is enlarged, gui Test Result disappears and suite name is truncated
- 891265 Add /cleanup to nunit-console.exe
- 891326 Non-runnable and statically ignored tests should disable the Run item on the context menu

### NUnit 2.6 Beta 1 - Version 2.6.0.11240 - August 28, 2011

#### General

- NUnit is now built using .NET 3.5. All NUnit assemblies and most tests target .NET 2.0 but the full set of tests requires 3.5 to execute.
- The build script now supports building from source under .NET 4.0. The script selects either .NET 3.5 or .NET 4.0 to perform the build, depending on what is available.
- NAnt 0.91 alpha2 release is now used for building on Windows. The 0.90 release is still used on Linux.
- Support for .NET 1.0 / 1.1 is no longer included in the main distribution for NUnit but is provided as a separate package.
- NUnit Mocks is now deprecated. All classes are now marked as obsolete.
- NUnit now uses the NSubstitute mock framework its own tests. A copy of the NSubstitute dll is included in the distribution.

#### Framework

- NUnit now supports composable Action Attributes, which allow the test developer to put reusable test actions into attributes and attach these actions to suites, tests, and test cases. The actions can run arbitrary code before and after suites, tests, and test cases execute. It enables the test developer to build smaller reusable actions and to compose them in unique ways for each suite, test, or test case.

  Note: This feature is experimental and details are likely to change in the final release.

- PlatformAttribute accepts "Net-3.0", "Net-3.5", "Mono-3.0" and "Mono-3.5" as arguments. Since these frameworks all use the 2.0 runtime, the semantics of their use is slightly different from other key words. The "3.5" arguments also include "3.0" and "2.0" and the "3.0" arguments include "2.0" in their interpretation.
- TestFixtureAttribute now accepts a Category named parameter, allowing individual fixture instances to be included in or excluded from a test run.

#### Console

- The .NET 1.1 build of nunit-console no longer supports the -process or -framework option. There is no automatic runtime detection and tests execute under same runtime as the console runner itself. If this functionality is needed when running tests under .NET 1.1, use the standard console runner to execute the tests in a separate process.
- The following new command-line options are provided:
  - -result is a synonym for -xml, specifying the file to be used for output of the test results in XML form. The -xml option is still recognized but will be removed in a future release.
  - -noresult allows supressing the xml result output entirely.
  - -work is used to specify the directory to be used for output files. Any relative paths specified with the -output, -err or -result options are resolved using this directory as a base.
  - -runlist allows the user to specify a file that contains the names of the tests to be executed rather than listing them directly on the command line.

#### Gui

- The Project Editor is now a separate program, which may be executed directly or run through the Project | Edit dropdown menu of the NUnit GUI. The editor now provides two main views of the project: a property-oriented view based on the Project Editor that was built into earlier versions of the NUnit GUI and an xml view, which allows simple editing of the .nunit file.

#### PNUnit

- The PNUnit code has been updated using the latest build from the developers at Codice Software and additional examples are provided in the source.

#### Bug Fixes

- 691129 Add Category parameter to TestFixture
- 692180 Script should allow building for net-2.0 under 3.5 or 4.0
- 701331 TestFixture attributes on base classes are not ignored
- 702734 Separate packaging of NUnit for .NET 1.1 and 2.0
- 711330 Test-free assembly given failure icon in tree display
- 712444 nunit-console /run don't execute parameterized test-cases (with commas in test-case name)
- 726313 Failure in Assembly level Action attribute causes crash
- 728500 TestDomain should unload the test AppDomain
- 735851 Add detection of 3.0, 3.5 and 4.0 frameworks to PlatformAttribute
- 736062 Deadlock when EventListener performs a Trace call + EventPump synchronisation
- 739039 Add noxml option to console runner
- 741402 Error running .NET 1.1 console tests
- 746247 Add AllowPartiallyTrustedCallersAttribute to nunit.framework assembly
- 747581 Failure in TestFixtureTearDown not reported in console runner
- 756843 Failing assertion does not show non-linear tolerance mode
- 787106 EqualConstraint provides inadequate failure information for IEnumerables
- 806198 nunit console crashes when opening certain projects with common output path
- 816863 System.NullReferenceException 2.6.0.11089
- 828739 Run NUnit tests listed in a file