Repository navigation
Support NUnit 5 #309
Description
Description
FsUnit 7.1.1 constrains its NUnit dependency to NUnit 4.x, so projects using FsUnit cannot upgrade to NUnit 5.
NUnit 5 removes several APIs that were deprecated in NUnit 4, including TestDelegate, AsyncTestDelegate, and ActualValueDelegate<T>. FsUnit currently uses APIs affected by these removals, so updating the NUnit dependency requires corresponding source changes.
NUnit 5 also no longer targets .NET 6. Its supported target frameworks are net462, net8.0, and net10.0. Because parts of the FsUnit repository currently target .NET 6, the repository's target frameworks must also be updated before it can move to NUnit 5.
NUnit documents these breaking changes here:
https://docs.nunit.org/articles/nunit/V5BreakingChanges.html
Environment
- FsUnit: 7.1.1
- Current working NUnit version: 4.6.1
- Desired NUnit version: 5.x
- Consumer target framework:
net10.0
Expected behavior
FsUnit should support NUnit 5 so that consuming projects can update to the latest NUnit major version.
Actual behavior
FsUnit's package dependency currently constrains consumers to NUnit 4.x. Updating or building FsUnit against NUnit 5 also produces compile errors because NUnit 5 removed APIs such as TestDelegate.
Proposed implementation approach
Supporting NUnit 5 appears to require updating the repository's build environment and target frameworks first. One possible sequence would be:
-
Replace the FAKE CLI/script-based build with a dedicated F# build project.
- The FAKE runner currently uses .NET 6 runtime assemblies.
- A dedicated build project can be run with
dotnet runand makes future SDK and runtime upgrades easier. - FAKE documents this approach here:
https://fake.build/guide/getting-started.html#Run-FAKE-using-a-dedicated-build-project
-
Move the repository from .NET 6 to a framework supported by NUnit 5.
- NUnit 5 targets
net462,net8.0, andnet10.0; it no longer targets .NET 6. - This could be done as separate .NET 6 → 8 and .NET 8 → 10 upgrades, or directly from .NET 6 → 10.
- I do not have a preference and would follow the maintainers' preferred migration path.
- NUnit 5 targets
-
Update the NUnit dependency to NUnit 5 and adapt FsUnit to the changed APIs.
- In particular, replace uses of the NUnit-specific delegate types removed in NUnit 5 with the corresponding standard .NET delegate types.
- An initial implementation showing the necessary changes is available in:
Update to NUnit5 and .Net8 #308
These steps could remain part of this issue or be split into separate implementation issues or pull requests if that would be easier to review and manage.
Willingness to contribute
I am willing to implement the complete migration, including the build changes, target framework updates, and NUnit 5 compatibility changes.
Before investing further time, I would appreciate feedback from the maintainers about:
- Whether NUnit 5 support is desired
- Whether a dedicated FAKE build project is the preferred way to remove the .NET 6 build dependency
- Whether the repository should move through .NET 8 first or go directly to .NET 10
- Whether the work should be submitted as one change or as several smaller pull requests
Activity