Skip to content

Support NUnit 5 on .NET 8 - #310

Merged
sergey-tihon merged 2 commits into
masterfrom
copilot/support-nunit-5
Oct 9, 2026
Merged

sergey-tihon merged 2 commits into
masterfrom
copilot/support-nunit-5

Conversation

Copilot AI commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

FsUnit’s NUnit dependency and .NET 6 targets prevented consumers from upgrading to NUnit 5. This updates the repository to .NET 8 and adapts FsUnit to NUnit 5’s delegate APIs.

  • NUnit compatibility: Upgrade to NUnit 5 and replace removed NUnit-specific delegates with System.Action.
    let shouldFail (f: unit -> unit) =
        System.Action(f) |> should throw typeof<AssertionException>
  • Framework and packaging: Move project targets and package assets to .NET 8, which remains consumable by .NET 10 projects. Update documentation references and CI SDK setup; retain .NET 6 for the existing FAKE runner.

Copilot AI linked an issue Oct 9, 2026 that may be closed by this pull request
Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Copilot AI changed the title [WIP] Update FsUnit to support NUnit 5 Support NUnit 5 on .NET 8 Oct 9, 2026
Copilot AI requested a review from sergey-tihon October 9, 2026 07:49
@sergey-tihon
sergey-tihon marked this pull request as ready for review October 9, 2026 13:08
Copilot AI balanced review requested due to automatic review settings October 9, 2026 13:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The framework, packaging, CI, documentation, and NUnit delegate changes are consistent and covered by the existing test suites.

0 open findings

What changed in this PR

Updates FsUnit for NUnit 5 and .NET 8 while retaining .NET 6 for the FAKE runner.

Changes:

  • Migrates projects, CI, documentation, and package assets to .NET 8.
  • Upgrades NUnit to 5.0 and replaces removed delegates with System.Action.
  • Regenerates Paket dependency constraints.
File Description
.github/​workflows/​main.yml Installs .NET 8 and FAKE’s .NET 6 SDK.
global.json Pins the .NET 8 SDK.
paket.dependencies Targets .NET 8 and requests NUnit 5.
paket.lock Locks updated frameworks and dependencies.
docs/​NUnit.fsx References .NET 8 assemblies.
docs/​index.fsx References .NET 8 assemblies.
docs/​FsUnitTyped.fsx References .NET 8 assemblies.
src/​FsUnit.NUnit/​FsUnit.fs Adapts assertions to NUnit 5 delegates.
src/​FsUnit.NUnit/​FsUnitTyped.fs Uses System.Action for typed assertions.
src/​FsUnit.NUnit/​FsUnit.NUnit.fsproj Targets .NET 8.
src/​FsUnit.NUnit/​paket.template Packages .NET 8 assets.
src/​FsUnit.Xunit/​FsUnit.Xunit.fsproj Replaces its .NET 6 target.
src/​FsUnit.Xunit/​paket.template Packages .NET 8 assets.
src/​FsUnit.MsTestUnit/​FsUnit.MsTest.fsproj Replaces its .NET 6 target.
src/​FsUnit.MsTestUnit/​paket.template Packages .NET 8 assets.
tests/​FsUnit.NUnit.Test/​FsUnit.NUnit.Test.fsproj Runs NUnit tests on .NET 8.
tests/​FsUnit.Xunit.Test/​FsUnit.Xunit.Test.fsproj Runs xUnit tests on .NET 8.
tests/​FsUnit.MsTest.Test/​FsUnit.MsTest.Test.fsproj Runs MSTest tests on .NET 8.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sergey-tihon
sergey-tihon requested a review from CaptnCodr October 9, 2026 13:19
@CaptnCodr

Copy link
Copy Markdown
Member

Besides that the dedicated project to substitute the FAKE script would be nice to drop .NET6 at some time.

@sergey-tihon

Copy link
Copy Markdown
Member

How do you see it? Migration to Fun.Build or another solution?

@CaptnCodr

Copy link
Copy Markdown
Member

Either that or run FAKE from a fsproj as the statement says:
fsprojects/FAKE#2875
And that is mentioned in the Getting started guide: https://fake.build/guide/getting-started.html#Run-FAKE-using-a-dedicated-build-project

@Wotee

Wotee commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

@CaptnCodr Like I said on the #309 I am willing to help to make these changes happen. I have a POC of that Fake build project on my local machine already and I can open a PR for that if you want. Or I can create another issue with detailed instructions if the Copilot way is the way you want to move forward.

@CaptnCodr

Copy link
Copy Markdown
Member

@sergey-tihon Then we can merge this and @Wotee can open a PR for the Fake build project.

@sergey-tihon
sergey-tihon merged commit afd84a8 into master Oct 9, 2026
4 checks passed
@sergey-tihon

Copy link
Copy Markdown
Member

@Wotee, sorry, my bad. I've got an email about the new issue and assigned it to Copilot without checking PRs.
Please open a PR with the migration to the FAKE project

@sergey-tihon
sergey-tihon deleted the copilot/support-nunit-5 branch October 9, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support NUnit 5

5 participants