Skip to content

Commit 1b2d4f8

Browse files
authored
Merge pull request #1169 from nunit/releasenotesNUnit460
Release notes for NUnit 4.6.0
2 parents 0bd47ca + 75485a6 commit 1b2d4f8

1 file changed

Lines changed: 156 additions & 0 deletions

File tree

docs/articles/nunit/release-notes/framework.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,165 @@ uid: frameworkreleasenotes
33
---
44
<!-- markdownlint-disable-file MD013 -->
55
<!-- markdownlint-disable-file MD033 -->
6+
<!-- markdownlint-disable-file MD060 -->
67

78
# Framework Release
89

10+
## NUnit 4.6.0 - May 4, 2026
11+
12+
This is a release with several enhancements, more type safety and several bugs fixed.
13+
14+
If you're using [TestDelegate](https://docs.nunit.org/api/NUnit.Framework.TestDelegate.html) or [ActualValueDelegate](https://docs.nunit.org/api/NUnit.Framework.Constraints.ActualValueDelegate-1.html) and you're on .net 8 or lower, then be aware of the requirement for how to avoid ambiguity errors, see the [Breaking changes section on Issue4824](#the-following-issues-are-marked-as-breaking-changes).
15+
16+
Please also update the NUnit.Analyzers package to version 4.13.
17+
18+
There are 27 issues fixed in this release.
19+
20+
### Enhancements
21+
22+
* [5232](https://github.com/nunit/nunit/issues/5232) Run the collection equivalency tests on MacOS. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5234](https://github.com/nunit/nunit/pull/5234)
23+
* [5173](https://github.com/nunit/nunit/issues/5173) Access to the actual Exception object. Thanks to NUnit Team member [Manfred Brands](https://github.com/manfred-brands) for [PR 5217](https://github.com/nunit/nunit/pull/5217)
24+
* [5158](https://github.com/nunit/nunit/issues/5158) Constants for canonical platform names. Thanks to [Jonathan Gilbert](https://github.com/logiclrd) for [PR 5159](https://github.com/nunit/nunit/pull/5159)
25+
* [5132](https://github.com/nunit/nunit/issues/5132) Thread.Abort() in Test causes "Test cancelled by user" result for NUnit 4.5.0. Thanks to NUnit Team member [Manfred Brands](https://github.com/manfred-brands) for [PR 5171](https://github.com/nunit/nunit/pull/5171)
26+
* [4824](https://github.com/nunit/nunit/issues/4824) Convert `TestDelegate` and `ActualValueDelegate` to `Action` and `Func&lt;T&gt;`. Thanks to NUnit Team member [Manfred Brands](https://github.com/manfred-brands) for [PR 5196](https://github.com/nunit/nunit/pull/5196)
27+
* [4254](https://github.com/nunit/nunit/issues/4254) Improve performance of equivalency, superset, and subset constraints for homogenous collections. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5224](https://github.com/nunit/nunit/pull/5224)
28+
* [4240](https://github.com/nunit/nunit/issues/4240) Feature request: Run the tests in main thread. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5188](https://github.com/nunit/nunit/pull/5188)
29+
* [4156](https://github.com/nunit/nunit/issues/4156) [Timeout] doesn't work on abstract class fixtures. Thanks to NUnit Team member [Manfred Brands](https://github.com/manfred-brands) for [PR 5167](https://github.com/nunit/nunit/pull/5167)
30+
* [4128](https://github.com/nunit/nunit/issues/4128) Improve how exception are displayed. Thanks to NUnit Team member [Manfred Brands](https://github.com/manfred-brands) for [PR 5216](https://github.com/nunit/nunit/pull/5216)
31+
* [3822](https://github.com/nunit/nunit/issues/3822) Make ArgDisplayNames public. Thanks to [Paul Irwin](https://github.com/paulirwin) for [PR 5236](https://github.com/nunit/nunit/pull/5236)
32+
* [3663](https://github.com/nunit/nunit/issues/3663) When TestCaseSource produces empty cases collection, test should be Passed/Failed/Inconclusive per creator expectation. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5125](https://github.com/nunit/nunit/pull/5125)
33+
* [2933](https://github.com/nunit/nunit/issues/2933) Add Is.SameAs overload with a reference type constraint. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5134](https://github.com/nunit/nunit/pull/5134)
34+
35+
### Bug fixes
36+
37+
* [5238](https://github.com/nunit/nunit/issues/5238) `HookData.Exception` will report an NUnit-wrapped exception object in `AfterTestHook(HookData hookData)`. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5240](https://github.com/nunit/nunit/pull/5240)
38+
* [5237](https://github.com/nunit/nunit/issues/5237) `Assert.Pass()` can cause `HookData.Exception` to be populated with an exception. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5240](https://github.com/nunit/nunit/pull/5240)
39+
* [5194](https://github.com/nunit/nunit/issues/5194) Add generic SameAs&lt;&gt; to `ConstraintExpression`. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5200](https://github.com/nunit/nunit/pull/5200)
40+
* [5179](https://github.com/nunit/nunit/issues/5179) Change in behaviour in v4.5 when passing a single "null" to a "params" test method via testcasesource. Thanks to NUnit Team member [Manfred Brands](https://github.com/manfred-brands) for [PR 5184](https://github.com/nunit/nunit/pull/5184)
41+
* [5178](https://github.com/nunit/nunit/issues/5178) Passing IEnumerable&lt;object&gt; from TestCaseSource to a generic method seems to break in some cases. Thanks to NUnit Team member [Manfred Brands](https://github.com/manfred-brands) for [PR 5195](https://github.com/nunit/nunit/pull/5195)
42+
* [5161](https://github.com/nunit/nunit/issues/5161) PlatformAttribute is declared `AllowMultiple = true` but that doesn't work. Thanks to NUnit Team member [Manfred Brands](https://github.com/manfred-brands) for [PR 5166](https://github.com/nunit/nunit/pull/5166)
43+
* [5146](https://github.com/nunit/nunit/issues/5146) Stack overflow in PropertiesComparer when object has property of its own value type.
44+
* [4131](https://github.com/nunit/nunit/issues/4131) Platform filter is not inherited. Thanks to NUnit Team member [Manfred Brands](https://github.com/manfred-brands) for [PR 5166](https://github.com/nunit/nunit/pull/5166)
45+
46+
### Internal fixes
47+
48+
* [5198](https://github.com/nunit/nunit/issues/5198) Benchmarkdotnet. Thanks to NUnit Team member [Terje Sandstrom](https://github.com/OsirisTerje) for [PR 5203](https://github.com/nunit/nunit/pull/5203)
49+
* [5193](https://github.com/nunit/nunit/issues/5193) Update cake to v6.1. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5201](https://github.com/nunit/nunit/pull/5201)
50+
* [5189](https://github.com/nunit/nunit/issues/5189) Update cake to latest 5.x version. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5190](https://github.com/nunit/nunit/pull/5190)
51+
* [5186](https://github.com/nunit/nunit/issues/5186) Optimize NUnit's array unpacking. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5202](https://github.com/nunit/nunit/pull/5202)
52+
* [5182](https://github.com/nunit/nunit/issues/5182) Remove unnecessary NUnit analyzer suppressions from latest analyzer package. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5183](https://github.com/nunit/nunit/pull/5183)
53+
* [5168](https://github.com/nunit/nunit/issues/5168) Check tests and documentation for the Platform attribute. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5204](https://github.com/nunit/nunit/pull/5204)
54+
* [5154](https://github.com/nunit/nunit/issues/5154) Apply some internal string optimizations. Thanks to NUnit Team member [Steven Weerdenburg](https://github.com/stevenaw) for [PR 5155](https://github.com/nunit/nunit/pull/5155)
55+
56+
### The following issues are marked as breaking changes
57+
58+
* [4824](https://github.com/nunit/nunit/issues/4824) Convert `TestDelegate` and `ActualValueDelegate` to `Action` and `Func&lt;T&gt;`. Thanks to NUnit Team member [Manfred Brands](https://github.com/manfred-brands) for [PR 5196](https://github.com/nunit/nunit/pull/5196)
59+
60+
> [!IMPORTANT]
61+
> This issue is a partially breaking change.
62+
>
63+
> If you use TestDelegate and Action **explicitly**, you must either:
64+
> * Alternative 1: Set your target framework to .Net 9.0 or higher
65+
> * Alternative 2: You must set your language version to 13 or higher, and use the Visual Studio 2022 version 17.12 or higher, or use .Net 9 SDK (which includes the C# 13 compiler), while still targeting .net8 or lower.
66+
>
67+
> | Scenario | NUnit pre 4.6 | NUnit 4.6+ (.Net < 9.0) | NUnit 4.6+ (.Net >= 9.0) | NUnit 4.6+ (.Net<9.0 and langversion >=13) |
68+
> | ------------------------------------- | ------------------------------- | ----------------- | ------ | ----- |
69+
> | Inline lambda || ❌ (breaking) |||
70+
> | `Action` / `Func<T>` (inline lambda) | ✅ (via implicit conversion) | ❌ (breaking) |||
71+
> | `Action` / `Func<T>` (as variable) | ❌ (type mismatch) ||||
72+
> | Explicit `TestDelegate` usage || ❌ (breaking) |||
73+
> | Evaluates functions | ❗ (success, but no eval) ||||
74+
>
75+
> ---
76+
> Examples of explicit TestDelegate usages are:
77+
>
78+
> * Explicit variable (most common)
79+
> * Method return types
80+
> * Method parameters / helpers
81+
> * Fields / properties
82+
> * Extension / library code (important) (3rd party helpers or frameworks)
83+
>
84+
> Code for reproduction of these cases can be found at <https://github.com/nunit/nunit.issues/tree/main/Issue4824>
85+
86+
### Acknowledgements
87+
88+
We want to express our heartfelt gratitude to everyone who has contributed to this release
89+
by reporting bugs, suggesting enhancements, and providing valuable feedback.
90+
Your efforts help make NUnit better for the entire community.
91+
92+
A special thank you to the following reporters for identifying issues:
93+
94+
<table>
95+
<tr>
96+
<td><a href="https://github.com/AlexKay34">Alexander Kaiser</a></td>
97+
<td><a href="https://github.com/bmalrat">bmalrat</a></td>
98+
<td><a href="https://github.com/ccarmannt">ccarmannt</a></td>
99+
<td><a href="https://github.com/logiclrd">Jonathan Gilbert</a></td>
100+
</tr>
101+
<tr>
102+
<td><a href="https://github.com/jnm2">Joseph Musser</a></td>
103+
<td><a href="https://github.com/manfred-brands">Manfred Brands</a></td>
104+
<td><a href="https://github.com/WindingWinter">OccamRazor</a></td>
105+
<td><a href="https://github.com/Sergey-Terekhin">Sergey Terekhin</a></td>
106+
</tr>
107+
<tr>
108+
<td><a href="https://github.com/Socolin">Socolin - Bertrand Provost</a></td>
109+
<td><a href="https://github.com/stevenaw">Steven Weerdenburg</a></td>
110+
<td><a href="https://github.com/OsirisTerje">Terje Sandstrom</a></td>
111+
<td><a href="https://github.com/tobyash86">tobyash86</a></td>
112+
</tr>
113+
<tr>
114+
<td><a href="https://github.com/MrPerun">Tomáš Vichta</a></td>
115+
<td><a href="https://github.com/willdean">Will Dean</a></td>
116+
</tr>
117+
</table>
118+
119+
and to the commenters who engaged in discussions and offered further insights:
120+
121+
<table>
122+
<tr>
123+
<td><a href="https://github.com/AlexKay34">Alexander Kaiser</a></td>
124+
<td><a href="https://github.com/cbmarcum">Carl Marcum</a></td>
125+
<td><a href="https://github.com/ccarmannt">ccarmannt</a></td>
126+
<td><a href="https://github.com/CharliePoole">CharliePoole</a></td>
127+
</tr>
128+
<tr>
129+
<td><a href="https://github.com/ChrisMaddock">Chris Maddock</a></td>
130+
<td><a href="https://github.com/komdil">Dilshod Komilov</a></td>
131+
<td><a href="https://github.com/twirlse">Evgeny Lukashevich</a></td>
132+
<td><a href="https://github.com/FireController1847">FireController#1847</a></td>
133+
</tr>
134+
<tr>
135+
<td><a href="https://github.com/logiclrd">Jonathan Gilbert</a></td>
136+
<td><a href="https://github.com/JordanW9232">JordanW9232</a></td>
137+
<td><a href="https://github.com/jnm2">Joseph Musser</a></td>
138+
<td><a href="https://github.com/manfred-brands">Manfred Brands</a></td>
139+
</tr>
140+
<tr>
141+
<td><a href="https://github.com/mbcrawfo">Michael Crawford</a></td>
142+
<td><a href="https://github.com/mikkelbu">Mikkel Nylander Bundgaard</a></td>
143+
<td><a href="https://github.com/WindingWinter">OccamRazor</a></td>
144+
<td><a href="https://github.com/Dreamescaper">Oleksandr Liakhevych</a></td>
145+
</tr>
146+
<tr>
147+
<td><a href="https://github.com/paulirwin">Paul Irwin</a></td>
148+
<td><a href="https://github.com/rprouse">Rob Prouse</a></td>
149+
<td><a href="https://github.com/Sergey-Terekhin">Sergey Terekhin</a></td>
150+
<td><a href="https://github.com/SimonCropp">Simon Cropp</a></td>
151+
</tr>
152+
<tr>
153+
<td><a href="https://github.com/Socolin">Socolin - Bertrand Provost</a></td>
154+
<td><a href="https://github.com/z002Holpp">Stefan Holpp</a></td>
155+
<td><a href="https://github.com/stevenaw">Steven Weerdenburg</a></td>
156+
<td><a href="https://github.com/OsirisTerje">Terje Sandstrom</a></td>
157+
</tr>
158+
<tr>
159+
<td><a href="https://github.com/Mikhinja">Vlad Catalina</a></td>
160+
<td><a href="https://github.com/willdean">Will Dean</a></td>
161+
<td><a href="https://github.com/anoftc">Zsolt Szabo-Resch</a></td>
162+
</tr>
163+
</table>
164+
9165
## NUnit 4.5.1 - March 6, 2026
10166

11167
This is a patch release for 4.5.0, to fix some regression bugs.

0 commit comments

Comments
 (0)