Polyfill.NUnit
1.0.0-develop.10
See the version list below for details.
dotnet add package Polyfill.NUnit --version 1.0.0-develop.10
NuGet\Install-Package Polyfill.NUnit -Version 1.0.0-develop.10
<PackageReference Include="Polyfill.NUnit" Version="1.0.0-develop.10" />
<PackageVersion Include="Polyfill.NUnit" Version="1.0.0-develop.10" />
<PackageReference Include="Polyfill.NUnit" />
paket add Polyfill.NUnit --version 1.0.0-develop.10
#r "nuget: Polyfill.NUnit, 1.0.0-develop.10"
#:package Polyfill.NUnit@1.0.0-develop.10
#addin nuget:?package=Polyfill.NUnit&version=1.0.0-develop.10&prerelease
#tool nuget:?package=Polyfill.NUnit&version=1.0.0-develop.10&prerelease
Polyfill.NUnit
Purpose
Polyfill.NUnit lets you cross-target legacy frameworks (e.g. netcoreapp3.1, net5.0) while beginning to use selected features that NUnit 4 introduces. NUnit 4 raises its minimum supported target frameworks and will never support net5.0, so this library provides a transitional window: keep older TFMs in your multi-target matrix for maintenance while adopting newer, more expressive NUnit syntax.
What it provides
Focused, source-compatible polyfills that mimic NUnit 4 surface area where:
- The API is additive (safe forward removal once you move fully to NUnit 4)
- Behavior can match existing NUnit 4 functionality exactly, but does not guarantee it
- NUnit analyzers (and general modernization efforts) encourage newer syntax (e.g. collection expressions) that would otherwise not compile on NUnit 3
Currently included:
Is.EqualTo<T>(T[])generic array overload via a C# 14 extension onIs, enabling collection expression usage:Is.EqualTo([1, 2, 3]).using (Assert.EnterMultipleScope())for multiple assertion scopes.
Example
using NUnit.Framework;
[TestFixture]
public class SampleTests
{
[Test]
public void ArrayEquality_UsesPolyfilledOverload()
{
var data = new[] { 1, 2, 3 };
Assert.That(data, Is.EqualTo([1, 2, 3]));
}
[Test]
public void MultipleAsserts_CanUseEnterMultipleScope()
{
var data = new[] { 1, 2, 3 };
using (Assert.EnterMultipleScope())
{
Assert.That(data, Is.EqualTo([1, 2, 3]));
Assert.That(data, Is.EquivalentTo([3, 2, 1]));
}
}
}
Credits
All credits for the original NUnit design, concepts, and implementation belongs to the NUnit team. This project is unaffiliated and purely a compatibility aid and is very much slightly adopted code from the original NUnit source.
NUnit GitHub: https://github.com/nunit/nunit
License
MIT (see LICENSE file).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 is compatible. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 89 | 1/25/2026 |
| 1.0.0-develop.15 | 42 | 1/25/2026 |
| 1.0.0-develop.13 | 139 | 12/12/2025 |
| 1.0.0-develop.12 | 714 | 12/1/2025 |
| 1.0.0-develop.11 | 257 | 11/25/2025 |
| 1.0.0-develop.10 | 148 | 11/25/2025 |
| 1.0.0-develop.9 | 157 | 11/24/2025 |
| 1.0.0-develop.8 | 155 | 11/23/2025 |