CHANGES.md
For further changes, see release notes
All changes, see release notes
This release is the first beta release of NUnit 4.0. All changes, see release notes
This release fixes a new issue with the FixtureLifeCycle attribute where IDisposable test fixtures were not being disposed properly. As always, @gleb-osokin has been a great help with this new feature.
It also fixes a long-standing performance issue with CollectionAssert.AreEquivalent and the CollectionEquivalentConstraint when comparing large collections. The deep comparison that NUnit performs on the two collections will always have a worst case bound of O(n^2) but we have optimized it so that the majority of use cases will be closer to O(n).
We've also made significant optimizations to the OR filters for selecting tests using their full name. This dramatically improves test performance for large code bases that use dotnet test. Thanks to @pakrym for his help with this.
This release addresses several misses with the new FixtureLifeCycle attribute, switches to using SourceLink and NuGet snupkg packages for debugging into NUnit from your unit tests. It also addresses issues with the time format of ignored and explicit tests in the test results file.
The FixtureLifeCycle attribute has been added to indicate that an instance for a test fixture or all test fixtures in an assembly should be constructed for each test within the fixture or assembly.
This attribute may be applied to a test fixture (class) or to a test assembly. It is useful in combination with the Parallelizable Attribute so that a new instance of a test fixture is constructed for every test within the test fixture. This allows tests to run in isolation without sharing instance fields and properties during parallel test runs. This make running parallel tests easier because it is easier to make your tests thread safe.
This release also fixes several issues running tests in .NET 5.0. If your tests target .NET 5.0, we recommend updating to this release.
[Timeout] when debugger is attached<code> (block element) instead of <c> (inline element)[Suggestion] Improve TextMessageWriter output for numeric values[Platform] attribute fails with DllNotFoundException in WASMIComparable<float> (or any IComparable) fails comparison.This release of NUnit finally drops support for .NET 2.0. If your application still targets .NET 2.0, your tests will need to target at least .NET 3.5. Microsoft ended support for .NET 2.0 on July 12, 2011. Microsoft recommends that everyone migrate to at least .NET Framework 3.5 SP1 for security and performance fixes.
This release dramatically improves NUnit support for async tests including returning ValueTask and custom tasks from tests, improved handling of SynchronizationContexts and better exception handling.
The .NET Standard 2.0 version of NUnit continues to gain more functionality that is found in the .NET 4.5 version of the framework like setting the ApartmentState and enabling Timeout on tests.
Contains.Substring with Andchar comparison in v3.7 and higherrepository metadata..IgnoreCase modifier to an AnyOf constraint in collection constraintsAdded a namespace to the props file included in the NuGet package to make it compatible with versions of Visual Studio prior to VS 2017.
This release adds a .NET Standard 2.0 version of the framework which re-enables most of the features that have been missing in our earlier .NET Standard builds like parallelism, timeouts, directory and path based asserts, etc. It also contains numerous bug fixes and smaller enhancements. We've improved our XML docs, fixed performance issues and added more detail to Multiple Asserts.
This release also contains source-indexed PDB files allowing developers to debug into the NUnit Framework. This allows you to track down errors or see how the framework works.
In order to support the .NET Standard 2.0 version, the NUnit project switched to the new CSPROJ format and now requires Visual Studio 2017 to compile. This only effects people contributing to the project. NUnit still supports building and compiling your tests in older .NET IDEs and NUnit still supports older versions of the .NET Framework back to 2.0. For contributors, NUnit can now compile all supported targets on Windows, Linux and Mac using the Cake command line build.
build -t build firstSimpleEnumerableWithIEquatable test objectThis release addresses numerous parallelization issues that were introduced in 3.8
when method level parallelization was added. Most of the parallelization issues
resolved were tests never completing when using some combinations of parallel tests
and ApartmentState not being properly applied to tests in all cases.
This release fixes two critical regressions in the 3.8 release. The first caused the console runner to crash if you are using test parameters. The second issue caused collection constraints checking for multiple items in a collection to fail.
This release removes several methods and attributes that were marked obsolete in the original 3.0 release. Support for iOS and Android has been improved.
An issue that caused unit tests to run slower was addressed as was a bug that prevented the use of Assert.Multiple in async code.
The Order attribute can now also be applied to the class level to set the order that test fixtures will be run.
This is a hotfix release that addresses occasional hangs when using test parallelization and fixes crashes in NCrunch prior to version 3.9.
This release of NUnit expands on parallel test execution to allow test methods to be run in parallel. Please see the Parallelizable Attribute for more information.
NUnit 3.7 also drops the Portable build of the framework and replaces it with a .NET Standard 1.3 version to compliment the .NET Standard 1.6 version. This change enables several constraints and other features in the .NET Standard builds that weren't available in portable like Path and Directory based asserts.
The AssertionHelper class has been deprecated because it is seldom used and has not received any of the updates that Asserts and Constraints receive. If your code is using the AssertionHelper class, we recommend that you migrate your asserts.
--timeout is supplied on command lineThis is a hotfix release of the framework that addresses critical issues found in the 3.6 release.
This release of the framework no longer includes builds for Compact Framework or for SilverLight, but adds a .NET Standard 1.6 build. If anyone still using Compact Framework or SilverLight and would like to continue development on those versions of the framework, please contact the NUnit team.
ICollection<T> is a listThis is the first version of NUnit where the framework will be released separately from the console runner, engine and other extensions. From this point forward, the NUnit Framework will be released on its own schedule that is not bound to that of any other NUnit project and version numbers may diverge over time.
This is also the first release where the NUnit Framework will not be included in the installer. Only the console runner, engine and extensions will be available as an MSI installer. We recommend that you use the NUnit NuGet packages for the framework, but a ZIP file with the binaries will also be available.
Func<string> to Asserts to lazily evaluate exception messagesFunc<string> to lazily evaluate an exception messageIEquatable<T>dotnet test in .NET CLI and .NET CoreIEquatable<T> Should Use Most Specific MethodIEquatable<T>The engine now only sets the config file for project.nunit to project.config if project.config exists. Otherwise, each assembly uses its own config, provided it is run in a separate AppDomain by itself.
NOTE: It is not possible for multiple assemblies in the same AppDomain to use different configs. This is not an NUnit limitation, it's just how configs work!
The portable build now supports ASP.NET 5 and the new Core CLR.
NOTE: The nunit3-console runner cannot run tests that reference the portable build.
You may run such tests using NUnitLite or a platform-specific runner.
TestCaseAttribute and TestCaseData now allow modifying the test name without replacing it entirely.
The Silverlight packages are now separate downloads.
nunit3-console.IEquatable<T> where second object is derived from TTest<T> Method cannot determine type arguments for fixture when passed as IEnumerable<T>Nullable<bool> to Assert.IsTrue and Assert.IsFalseTargetInvocationException constraintsNOTE: Bug Fixes below this point refer to the number of the bug in Launchpad.
IEquatable<T>Comparer<T[]> if it is provided<startup/> element and also enable loadFromRemoteSourcesIEnumerable<T> for Datapoints doesn't workTask<T>IEnumerable<T> as well as on ArraysAssert.Catch<T> should return T