From 668bb1cba4cabac3be59d7973f997f6843f6b2bb Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Sat, 10 Oct 2026 12:52:05 +0200 Subject: [PATCH 01/10] Migrate Paket builds to NuGet CPM --- .config/dotnet-tools.json | 6 +- .github/workflows/main.yml | 2 - .github/workflows/publish.yml | 74 ++++++++++ .gitignore | 4 - Directory.Build.props | 15 ++ Directory.Packages.props | 18 +++ FsUnit.slnx | 3 - README.md | 3 + build.cmd | 1 - build.sh | 1 - build/build.fs | 35 ++--- build/build.fsproj | 3 +- docs/FsUnitTyped.fsx | 4 +- docs/MsTest.fsx | 8 +- docs/NUnit.fsx | 6 +- docs/index.fsx | 4 +- docs/xUnit.fsx | 10 +- paket.dependencies | 21 --- paket.lock | 132 ------------------ src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj | 18 +-- src/FsUnit.MsTestUnit/FsUnitSample.fs.pp | 24 ---- src/FsUnit.MsTestUnit/paket.references | 3 - src/FsUnit.MsTestUnit/paket.template | 32 ----- src/FsUnit.MsTestUnit/sample.paket.template | 27 ---- src/FsUnit.NUnit/FsUnit.NUnit.fsproj | 15 +- src/FsUnit.NUnit/FsUnitSample.fs.pp | 24 ---- src/FsUnit.NUnit/paket.references | 2 - src/FsUnit.NUnit/paket.template | 30 ---- src/FsUnit.NUnit/sample.paket.template | 27 ---- src/FsUnit.Xunit/FsUnit.Xunit.fsproj | 19 +-- src/FsUnit.Xunit/FsUnitSample.fs.pp | 23 --- src/FsUnit.Xunit/paket.references | 3 - src/FsUnit.Xunit/paket.template | 32 ----- src/FsUnit.Xunit/sample.paket.template | 27 ---- src/install.ps1 | 3 - .../FsUnit.MsTest.Test.fsproj | 5 +- tests/FsUnit.MsTest.Test/paket.references | 4 - .../FsUnit.NUnit.Test.fsproj | 6 +- tests/FsUnit.NUnit.Test/paket.references | 5 - .../FsUnit.Xunit.Test.fsproj | 5 +- tests/FsUnit.Xunit.Test/paket.references | 4 - 41 files changed, 183 insertions(+), 505 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 Directory.Build.props create mode 100644 Directory.Packages.props delete mode 100644 paket.dependencies delete mode 100644 paket.lock delete mode 100644 src/FsUnit.MsTestUnit/FsUnitSample.fs.pp delete mode 100644 src/FsUnit.MsTestUnit/paket.references delete mode 100644 src/FsUnit.MsTestUnit/paket.template delete mode 100644 src/FsUnit.MsTestUnit/sample.paket.template delete mode 100644 src/FsUnit.NUnit/FsUnitSample.fs.pp delete mode 100644 src/FsUnit.NUnit/paket.references delete mode 100644 src/FsUnit.NUnit/paket.template delete mode 100644 src/FsUnit.NUnit/sample.paket.template delete mode 100644 src/FsUnit.Xunit/FsUnitSample.fs.pp delete mode 100644 src/FsUnit.Xunit/paket.references delete mode 100644 src/FsUnit.Xunit/paket.template delete mode 100644 src/FsUnit.Xunit/sample.paket.template delete mode 100644 src/install.ps1 delete mode 100644 tests/FsUnit.MsTest.Test/paket.references delete mode 100644 tests/FsUnit.NUnit.Test/paket.references delete mode 100644 tests/FsUnit.Xunit.Test/paket.references diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 9142c876..7625673b 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -2,10 +2,10 @@ "version": 1, "isRoot": true, "tools": { - "paket": { - "version": "11.0.0", + "dotnet-outdated-tool": { + "version": "4.8.1", "commands": [ - "paket" + "dotnet-outdated" ] }, "fsdocs-tool": { diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1f29dea4..c69e4951 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,5 @@ jobs: - name: Install local tools run: dotnet tool restore - - name: Paket Restore - run: dotnet paket restore - name: Build and Test run: dotnet run --project build/build.fsproj diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..664fd103 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,74 @@ +name: Publish NuGet packages + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v7 + - name: Setup .NET SDKs and .NET 8 runtime + uses: actions/setup-dotnet@v6 + with: + dotnet-version: 8.0.x + global-json-file: global.json + - name: Install local tools + run: dotnet tool restore + - name: Build NuGet packages + run: dotnet run --project build/build.fsproj -- NuGet + - name: Verify tag version and packages + env: + TAG: ${{ github.ref_name }} + run: | + version="${TAG#v}" + if [[ "$version" =~ ^([0-9]+\.[0-9]+\.[0-9]+)\.0$ ]]; then version="${BASH_REMATCH[1]}"; fi + for package in FsUnit FsUnit.xUnit Fs30Unit.MsTest; do + test -f "bin/${package}.${version}.nupkg" || { + echo "Missing bin/${package}.${version}.nupkg (tag ${TAG} must match RELEASE_NOTES.md)" >&2 + exit 1 + } + done + for package in FsUnit FsUnit.xUnit Fs30Unit.MsTest; do + test -f "bin/${package}.${version}.snupkg" || { + echo "Missing bin/${package}.${version}.snupkg (tag ${TAG} must match RELEASE_NOTES.md)" >&2 + exit 1 + } + done + - uses: actions/upload-artifact@v4 + with: + name: nuget-packages + path: | + bin/*.nupkg + bin/*.snupkg + if-no-files-found: error + + publish: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: nuget-packages + path: artifacts + # Configure a NuGet Trusted Publisher for fsprojects/FsUnit and this workflow (publish.yml). + # Store the NuGet.org account username (not email) in the NUGET_USER GitHub secret. + - name: NuGet login (Trusted Publishing) + id: nuget-login + uses: NuGet/login@v1 + with: + user: ${{ secrets.NUGET_USER }} + - name: Push packages to NuGet.org + env: + NUGET_API_KEY: ${{ steps.nuget-login.outputs.NUGET_API_KEY }} + run: | + for package in artifacts/*.nupkg; do + dotnet nuget push "$package" --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate + done diff --git a/.gitignore b/.gitignore index 2a6a6868..cbbb3a67 100644 --- a/.gitignore +++ b/.gitignore @@ -100,10 +100,6 @@ output/ # Test results produced by build TestResults.xml -# Paket dependency manager -paket-files -.paket/ - # Nuget outputs nuget/*.nupkg release.cmd diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..4af0a2dd --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,15 @@ + + + true + snupkg + true + Ray Vernagus; Daniel Mohl; Sergey Tihon; Constantin Tews + https://github.com/fsprojects/FsUnit + https://github.com/fsprojects/FsUnit + git + MIT + logo.png + false + Copyright 2012-2026 + + diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 00000000..aaf6f875 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,18 @@ + + + true + + + + + + + + + + + + + + + diff --git a/FsUnit.slnx b/FsUnit.slnx index 9444df71..766e4130 100644 --- a/FsUnit.slnx +++ b/FsUnit.slnx @@ -7,8 +7,6 @@ - - @@ -21,7 +19,6 @@ - diff --git a/README.md b/README.md index 9744453a..332268cd 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,9 @@ A few things to keep in mind: ## Build Instructions - Find and run either `./build.sh` or `build.cmd` (depending on your platform). +- Restore local tools with `dotnet tool restore`; use `dotnet outdated` to review or update NuGet dependencies. +- Push a `v` tag matching the latest entry in `RELEASE_NOTES.md` to build and publish all six NuGet packages. +- Configure a NuGet.org Trusted Publisher for `fsprojects/FsUnit` and `.github/workflows/publish.yml`; add the NuGet account username (not email) as the `NUGET_USER` GitHub secret. ## Maintainer(s) diff --git a/build.cmd b/build.cmd index 07af35cd..ca2e1d78 100644 --- a/build.cmd +++ b/build.cmd @@ -2,5 +2,4 @@ cls dotnet tool restore -dotnet paket restore dotnet run --project build/build.fsproj -- %* diff --git a/build.sh b/build.sh index 15694036..a942e852 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,4 @@ #!/bin/bash dotnet tool restore -dotnet paket restore dotnet run --project build/build.fsproj -- "$@" diff --git a/build/build.fs b/build/build.fs index 50eb2e7b..ceb87ffd 100644 --- a/build/build.fs +++ b/build/build.fs @@ -81,13 +81,6 @@ Target.create "AssemblyInfo" (fun _ -> | Csproj -> AssemblyInfoFile.createCSharp ((folderName @@ "Properties") @@ "AssemblyInfo.cs") attributes | Vbproj -> AssemblyInfoFile.createVisualBasic ((folderName @@ "My Project") @@ "AssemblyInfo.vb") attributes)) -// Copies binaries from default VS location to expected bin folder -// But keeps a subdirectory structure for each project in the -// src folder to support multiple project outputs -Target.create "CopyBinaries" (fun _ -> - !! "src/**/*.??proj" - |> Seq.map (fun f -> ((Path.GetDirectoryName f) @@ "bin/Release", "bin" @@ (Path.GetFileNameWithoutExtension f))) - |> Seq.iter (fun (fromDir, toDir) -> Shell.copyDir toDir fromDir (fun _ -> true))) // -------------------------------------------------------------------------------------- // Clean build results @@ -172,21 +165,23 @@ Target.create "MsTest" (fun _ -> Target.create "RunTests" ignore // -------------------------------------------------------------------------------------- -// Build a NuGet package +// Build NuGet packages with the .NET SDK Target.create "NuGet" (fun _ -> - Paket.pack (fun p -> - { p with - ToolType = ToolType.CreateLocalTool() - OutputPath = "bin" - Version = version - ReleaseNotes = String.toLines release.Notes })) + // MSBuild splits -p: values on ',' and ';'; environment variables are read as properties verbatim. + Environment.setEnvironVar "PackageReleaseNotes" (String.toLines release.Notes) + + let pack projectPath extraProperties = + let result = + DotNet.exec id "pack" $"%s{projectPath} -c Release -o bin -p:Version=%s{version} %s{extraProperties}" + + if not result.OK then + failwithf "Package build failed for %s: %A" projectPath result.Errors + [ "src/FsUnit.NUnit/FsUnit.NUnit.fsproj" + "src/FsUnit.Xunit/FsUnit.Xunit.fsproj" + "src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj" ] + |> List.iter (fun projectPath -> pack projectPath "")) -Target.create "PublishNuget" (fun _ -> - Paket.push (fun p -> - { p with - ToolType = ToolType.CreateLocalTool() - WorkingDir = "bin" })) // -------------------------------------------------------------------------------------- @@ -221,7 +216,6 @@ Target.create "Release" ignore ==> "AssemblyInfo" ==> "CheckFormat" ==> "Build" - ==> "CopyBinaries" ==> "RunTests" ==> "All" @@ -231,6 +225,7 @@ Target.create "Release" ignore ==> "MsTest" ==> "RunTests" + "All" ==> "NuGet" ==> "GenerateDocs" diff --git a/build/build.fsproj b/build/build.fsproj index a16b7974..117a44ec 100644 --- a/build/build.fsproj +++ b/build/build.fsproj @@ -2,6 +2,8 @@ Exe net8.0 + + false @@ -14,7 +16,6 @@ - diff --git a/docs/FsUnitTyped.fsx b/docs/FsUnitTyped.fsx index 910b728d..b697b501 100644 --- a/docs/FsUnitTyped.fsx +++ b/docs/FsUnitTyped.fsx @@ -1,8 +1,8 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "../packages/NUnit/lib/net8.0/nunit.framework.dll" -#r "../bin/FsUnit.NUnit/net8.0/FsUnit.NUnit.dll" +#r "../tests/FsUnit.NUnit.Test/bin/Release/net8.0/nunit.framework.dll" +#r "../tests/FsUnit.NUnit.Test/bin/Release/net8.0/FsUnit.NUnit.dll" (** What is FsUnitTyped? diff --git a/docs/MsTest.fsx b/docs/MsTest.fsx index b791d883..b9e7262d 100644 --- a/docs/MsTest.fsx +++ b/docs/MsTest.fsx @@ -1,9 +1,9 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "../packages/MSTest.TestFramework/lib/netstandard2.0/Microsoft.VisualStudio.TestPlatform.TestFramework.dll" -#r "../packages/NHamcrest/lib/netstandard2.0/NHamcrest.dll" -#r "../bin/FsUnit.MsTest/netstandard2.0/FsUnit.MsTest.dll" +#r "../tests/FsUnit.MsTest.Test/bin/Release/net8.0/Microsoft.VisualStudio.TestPlatform.TestFramework.dll" +#r "../tests/FsUnit.MsTest.Test/bin/Release/net8.0/NHamcrest.dll" +#r "../tests/FsUnit.MsTest.Test/bin/Release/net8.0/FsUnit.MsTest.dll" (** FsUnit for MsTest @@ -15,8 +15,6 @@ FsUnit for MsTest
The FsUnit library for MsTest can be installed from NuGet:
PM> Install-Package Fs30Unit.MsTest
- Sample FsUnit tests for MsTest can be installed from NuGet: -
PM> Install-Package Fs30Unit.MsTest.Sample
diff --git a/docs/NUnit.fsx b/docs/NUnit.fsx index f6bb9be3..152a77d8 100644 --- a/docs/NUnit.fsx +++ b/docs/NUnit.fsx @@ -1,8 +1,8 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "../packages/NUnit/lib/net8.0/nunit.framework.dll" -#r "../bin/FsUnit.NUnit/net8.0/FsUnit.NUnit.dll" +#r "../tests/FsUnit.NUnit.Test/bin/Release/net8.0/nunit.framework.dll" +#r "../tests/FsUnit.NUnit.Test/bin/Release/net8.0/FsUnit.NUnit.dll" open NUnit.Framework (** @@ -15,8 +15,6 @@ FsUnit for NUnit
The FsUnit library for NUnit can be installed from NuGet:
PM> Install-Package FsUnit
- Sample FsUnit tests for NUnit can be installed from NuGet: -
PM> Install-Package FsUnit.Sample
diff --git a/docs/index.fsx b/docs/index.fsx index 753f4442..bd592221 100644 --- a/docs/index.fsx +++ b/docs/index.fsx @@ -1,8 +1,8 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "../packages/NUnit/lib/net8.0/nunit.framework.dll" -#r "../bin/FsUnit.NUnit/net8.0/FsUnit.NUnit.dll" +#r "../tests/FsUnit.NUnit.Test/bin/Release/net8.0/nunit.framework.dll" +#r "../tests/FsUnit.NUnit.Test/bin/Release/net8.0/FsUnit.NUnit.dll" open FsUnit diff --git a/docs/xUnit.fsx b/docs/xUnit.fsx index 783309fd..75b68cd5 100644 --- a/docs/xUnit.fsx +++ b/docs/xUnit.fsx @@ -1,9 +1,11 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "../packages/xunit.extensibility.core/lib/netstandard1.1/xunit.core.dll" -#r "../packages/NHamcrest/lib/netstandard2.0/NHamcrest.dll" -#r "../bin/FsUnit.Xunit/netstandard2.0/FsUnit.Xunit.dll" +#r "../tests/FsUnit.Xunit.Test/bin/Release/net8.0/xunit.v3.core.dll" +#r "../tests/FsUnit.Xunit.Test/bin/Release/net8.0/xunit.v3.common.dll" +#r "../tests/FsUnit.Xunit.Test/bin/Release/net8.0/xunit.v3.assert.dll" +#r "../tests/FsUnit.Xunit.Test/bin/Release/net8.0/NHamcrest.dll" +#r "../tests/FsUnit.Xunit.Test/bin/Release/net8.0/FsUnit.Xunit.dll" (** FsUnit for xUnit @@ -15,8 +17,6 @@ FsUnit for xUnit
The FsUnit library for xUnit can be installed from NuGet:
PM> Install-Package FsUnit.xUnit
- Sample FsUnit tests for xUnit can be installed from NuGet: -
PM> Install-Package FsUnit.xUnit.Sample
diff --git a/paket.dependencies b/paket.dependencies deleted file mode 100644 index a7647eb0..00000000 --- a/paket.dependencies +++ /dev/null @@ -1,21 +0,0 @@ -source https://api.nuget.org/v3/index.json -framework: net8.0, netstandard2.0 - -nuget FSharp.Core ~> 5.0.0 - -nuget Microsoft.NET.Test.Sdk - -// NUnit -nuget NUnit ~> 5.0.0 -nuget NUnit3TestAdapter -nuget System.Collections.Immutable -nuget System.Collections.NonGeneric - -// xUnit -nuget NHamcrest -nuget xunit.v3 ~> 1.0.0 -nuget xunit.runner.visualstudio - -// MsTest -nuget MSTest.TestFramework ~> 3.6.0 -nuget MSTest.TestAdapter ~> 3.6.0 diff --git a/paket.lock b/paket.lock deleted file mode 100644 index ad07dae4..00000000 --- a/paket.lock +++ /dev/null @@ -1,132 +0,0 @@ -RESTRICTION: || (== net8.0) (== netstandard2.0) -NUGET - remote: https://api.nuget.org/v3/index.json - FSharp.Core (5.0.2) - Microsoft.ApplicationInsights (2.22) - System.Diagnostics.DiagnosticSource (>= 5.0) - Microsoft.Bcl.AsyncInterfaces (9.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - Microsoft.CodeCoverage (17.12) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) - Microsoft.NET.Test.Sdk (17.12) - Microsoft.CodeCoverage (>= 17.12) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) - Microsoft.TestPlatform.TestHost (>= 17.12) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) - Microsoft.NETCore.Platforms (7.0.4) - Microsoft.NETCore.Targets (5.0) - Microsoft.Testing.Extensions.Telemetry (1.4.3) - Microsoft.ApplicationInsights (>= 2.22) - Microsoft.Testing.Platform (>= 1.4.3) - Microsoft.Testing.Extensions.TrxReport.Abstractions (1.4.3) - Microsoft.Testing.Platform (>= 1.4.3) - Microsoft.Testing.Extensions.VSTestBridge (1.4.3) - Microsoft.ApplicationInsights (>= 2.22) - Microsoft.Testing.Extensions.Telemetry (>= 1.4.3) - Microsoft.Testing.Extensions.TrxReport.Abstractions (>= 1.4.3) - Microsoft.Testing.Platform (>= 1.4.3) - Microsoft.TestPlatform.ObjectModel (>= 17.11.1) - Microsoft.Testing.Platform (1.4.3) - Microsoft.Testing.Platform.MSBuild (1.4.3) - Microsoft.Testing.Platform (>= 1.4.3) - Microsoft.TestPlatform.ObjectModel (17.12) - System.Reflection.Metadata (>= 1.6) - Microsoft.TestPlatform.TestHost (17.12) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) - Microsoft.TestPlatform.ObjectModel (>= 17.12) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) - Newtonsoft.Json (>= 13.0.1) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) - MSTest.TestAdapter (3.6.4) - Microsoft.Testing.Extensions.VSTestBridge (>= 1.4.3) - Microsoft.Testing.Platform.MSBuild (>= 1.4.3) - MSTest.TestFramework (3.6.4) - Newtonsoft.Json (13.0.3) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) - NHamcrest (4.0) - NUnit (5.0) - NUnit3TestAdapter (4.6) - System.Buffers (4.6) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) - System.Collections.Immutable (9.0) - System.Memory (>= 4.5.5) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) - System.Collections.NonGeneric (4.3) - System.Diagnostics.Debug (>= 4.3) - System.Globalization (>= 4.3) - System.Resources.ResourceManager (>= 4.3) - System.Runtime (>= 4.3) - System.Runtime.Extensions (>= 4.3) - System.Threading (>= 4.3) - System.Diagnostics.Debug (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.Diagnostics.DiagnosticSource (9.0) - System.Memory (>= 4.5.5) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) - System.Globalization (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.IO (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.Text.Encoding (>= 4.3) - System.Threading.Tasks (>= 4.3) - System.Memory (4.6) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) - System.Buffers (>= 4.6) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netcoreapp2.1)) (== netstandard2.0) - System.Numerics.Vectors (>= 4.6) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netcoreapp2.1)) (== netstandard2.0) - System.Runtime.CompilerServices.Unsafe (>= 6.1) - restriction: || (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netcoreapp2.1)) (== netstandard2.0) - System.Numerics.Vectors (4.6) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) - System.Reflection (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.IO (>= 4.3) - System.Reflection.Primitives (>= 4.3) - System.Runtime (>= 4.3) - System.Reflection.Metadata (9.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) - System.Collections.Immutable (>= 9.0) - System.Reflection.Primitives (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.Resources.ResourceManager (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Globalization (>= 4.3) - System.Reflection (>= 4.3) - System.Runtime (>= 4.3) - System.Runtime (4.3.1) - Microsoft.NETCore.Platforms (>= 1.1.1) - Microsoft.NETCore.Targets (>= 1.1.3) - System.Runtime.CompilerServices.Unsafe (6.1) - restriction: || (&& (== net8.0) (>= net462)) (== netstandard2.0) - System.Runtime.Extensions (4.3.1) - Microsoft.NETCore.Platforms (>= 1.1.1) - Microsoft.NETCore.Targets (>= 1.1.3) - System.Runtime (>= 4.3.1) - System.Text.Encoding (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - System.Threading (4.3) - System.Runtime (>= 4.3) - System.Threading.Tasks (>= 4.3) - System.Threading.Tasks (4.3) - Microsoft.NETCore.Platforms (>= 1.1) - Microsoft.NETCore.Targets (>= 1.1) - System.Runtime (>= 4.3) - xunit.analyzers (1.18) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - xunit.runner.visualstudio (3.0) - xunit.v3 (1.0) - xunit.analyzers (>= 1.18) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - xunit.v3.assert (1.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - xunit.v3.core (1.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - xunit.v3.assert (1.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - xunit.v3.common (1.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - Microsoft.Bcl.AsyncInterfaces (>= 6.0) - xunit.v3.core (1.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - Microsoft.Testing.Platform.MSBuild (>= 1.4.3) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - xunit.v3.extensibility.core (1.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - xunit.v3.runner.inproc.console (1.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - xunit.v3.extensibility.core (1.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - xunit.v3.common (1.0) - xunit.v3.runner.common (1.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - xunit.v3.common (1.0) - xunit.v3.runner.inproc.console (1.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - Microsoft.Testing.Extensions.TrxReport.Abstractions (>= 1.4.3) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - Microsoft.Testing.Platform (>= 1.4.3) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - xunit.v3.extensibility.core (1.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) - xunit.v3.runner.common (1.0) - restriction: || (== net8.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0)) diff --git a/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj b/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj index b8259e5a..f061c0fd 100644 --- a/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj +++ b/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj @@ -1,7 +1,10 @@  - net8.0;netstandard2.0 + net8.0 FsUnit.MsTest + Fs30Unit.MsTest + FsUnit is a set of extensions that add special testing syntax to MsTest. + F# fsharp MsTest FsUnit Library false @@ -17,12 +20,11 @@ CustomMatchers.fs
- - - - Always - - + +
+ + + + - \ No newline at end of file diff --git a/src/FsUnit.MsTestUnit/FsUnitSample.fs.pp b/src/FsUnit.MsTestUnit/FsUnitSample.fs.pp deleted file mode 100644 index 79edec98..00000000 --- a/src/FsUnit.MsTestUnit/FsUnitSample.fs.pp +++ /dev/null @@ -1,24 +0,0 @@ -namespace $rootnamespace$.Tests - -open Microsoft.VisualStudio.TestTools.UnitTesting -open FsUnit.MsTest - -type LightBulb(state) = - member x.On = state - override x.ToString() = - match x.On with - | true -> "On" - | false -> "Off" - -[] -type ``Given a LightBulb that has had its state set to true`` ()= - let lightBulb = LightBulb(true) - - [] member __. - ``when I ask whether it is On it answers true.`` ()= - lightBulb.On |> should be True - - [] member __. - ``when I convert it to a string it becomes "On".`` ()= - string lightBulb |> should equal "On" - diff --git a/src/FsUnit.MsTestUnit/paket.references b/src/FsUnit.MsTestUnit/paket.references deleted file mode 100644 index 31bc36e1..00000000 --- a/src/FsUnit.MsTestUnit/paket.references +++ /dev/null @@ -1,3 +0,0 @@ -FSharp.Core -NHamcrest -MSTest.TestFramework \ No newline at end of file diff --git a/src/FsUnit.MsTestUnit/paket.template b/src/FsUnit.MsTestUnit/paket.template deleted file mode 100644 index 88ec93a5..00000000 --- a/src/FsUnit.MsTestUnit/paket.template +++ /dev/null @@ -1,32 +0,0 @@ -type file -id - Fs30Unit.MsTest -owners - Ray Vernagus, Daniel Mohl, Sergey Tihon, Constantin Tews -authors - Ray Vernagus, Daniel Mohl, Sergey Tihon, Constantin Tews -projectUrl - https://github.com/fsprojects/FsUnit -iconUrl - https://raw.githubusercontent.com/fsprojects/FsUnit/master/docs/img/logo.png -licenseUrl - https://raw.githubusercontent.com/fsprojects/FsUnit/master/license.txt -requireLicenseAcceptance - false -copyright - Copyright 2012-2025 -tags - F# fsharp MsTest FsUnit -summary - The goals of FsUnit are to make unit-testing feel more functional while leverage existing testing frameworks. -description - FsUnit is a set of extensions that add special testing syntax to MsTest. -files - ../../bin/FsUnit.MsTest/net8.0/FsUnit.* ==> lib/net8.0 - ../../bin/FsUnit.MsTest/netstandard2.0/FsUnit.* ==> lib/netstandard2.0 - ../../src/install.ps1 ==> tools - -dependencies - MSTest.TestFramework >= LOCKEDVERSION - NHamcrest >= LOCKEDVERSION - FSharp.Core >= LOCKEDVERSION diff --git a/src/FsUnit.MsTestUnit/sample.paket.template b/src/FsUnit.MsTestUnit/sample.paket.template deleted file mode 100644 index dfa84899..00000000 --- a/src/FsUnit.MsTestUnit/sample.paket.template +++ /dev/null @@ -1,27 +0,0 @@ -type file -id - Fs30Unit.MsTest.Sample -owners - Ray Vernagus, Daniel Mohl, Sergey Tihon, Constantin Tews -authors - Ray Vernagus, Daniel Mohl, Sergey Tihon, Constantin Tews -projectUrl - https://github.com/fsprojects/FsUnit -iconUrl - https://raw.githubusercontent.com/fsprojects/FsUnit/master/docs/img/logo.png -licenseUrl - https://github.com/fsprojects/FsUnit/blob/master/license.txt -requireLicenseAcceptance - false -copyright - Copyright 2015-2025 -tags - F# fsharp MsTest FsUnit -summary - The goals of FsUnit are to make unit-testing feel more functional while leverage existing testing frameworks. -description - FsUnit is a set of extensions that add special testing syntax to MsTest. -dependencies - Fs30Unit.MsTest -files - ../../bin/FsUnit.MsTest/**/*.pp ==> content diff --git a/src/FsUnit.NUnit/FsUnit.NUnit.fsproj b/src/FsUnit.NUnit/FsUnit.NUnit.fsproj index 362e9e98..2f371092 100644 --- a/src/FsUnit.NUnit/FsUnit.NUnit.fsproj +++ b/src/FsUnit.NUnit/FsUnit.NUnit.fsproj @@ -2,6 +2,9 @@ net8.0 FsUnit.NUnit + FsUnit + FsUnit is a set of extensions that add special testing syntax to NUnit. + F# fsharp NUnit FsUnit Library false true @@ -19,12 +22,10 @@ - - - - Always - - + + + + + - \ No newline at end of file diff --git a/src/FsUnit.NUnit/FsUnitSample.fs.pp b/src/FsUnit.NUnit/FsUnitSample.fs.pp deleted file mode 100644 index 17c67fd7..00000000 --- a/src/FsUnit.NUnit/FsUnitSample.fs.pp +++ /dev/null @@ -1,24 +0,0 @@ -namespace $rootnamespace$.Tests - -open NUnit.Framework -open FsUnit - -type LightBulb(state) = - member x.On = state - override x.ToString() = - match x.On with - | true -> "On" - | false -> "Off" - -[] -type ``Given a LightBulb that has had its state set to true`` ()= - let lightBulb = LightBulb(true) - - [] member __. - ``when I ask whether it is On it answers true.`` ()= - lightBulb.On |> should be True - - [] member __. - ``when I convert it to a string it becomes "On".`` ()= - string lightBulb |> should equal "On" - diff --git a/src/FsUnit.NUnit/paket.references b/src/FsUnit.NUnit/paket.references deleted file mode 100644 index 9e3b9fdb..00000000 --- a/src/FsUnit.NUnit/paket.references +++ /dev/null @@ -1,2 +0,0 @@ -FSharp.Core -NUnit \ No newline at end of file diff --git a/src/FsUnit.NUnit/paket.template b/src/FsUnit.NUnit/paket.template deleted file mode 100644 index f52940d3..00000000 --- a/src/FsUnit.NUnit/paket.template +++ /dev/null @@ -1,30 +0,0 @@ -type file -id - FsUnit -owners - Ray Vernagus, Daniel Mohl, Sergey Tihon, Constantin Tews -authors - Ray Vernagus, Daniel Mohl, Sergey Tihon, Constantin Tews -projectUrl - https://github.com/fsprojects/FsUnit -iconUrl - https://raw.githubusercontent.com/fsprojects/FsUnit/master/docs/img/logo.png -licenseUrl - https://raw.githubusercontent.com/fsprojects/FsUnit/master/license.txt -requireLicenseAcceptance - false -copyright - Copyright 2012-2025 -tags - F# fsharp NUnit FsUnit -summary - The goals of FsUnit are to make unit-testing feel more functional while leverage existing testing frameworks. -description - FsUnit is a set of extensions that add special testing syntax to NUnit. -files - ../../bin/FsUnit.NUnit/net8.0/FsUnit.* ==> lib/net8.0 - ../../src/install.ps1 ==> tools - -dependencies - NUnit >= LOCKEDVERSION - FSharp.Core >= LOCKEDVERSION diff --git a/src/FsUnit.NUnit/sample.paket.template b/src/FsUnit.NUnit/sample.paket.template deleted file mode 100644 index 6522f710..00000000 --- a/src/FsUnit.NUnit/sample.paket.template +++ /dev/null @@ -1,27 +0,0 @@ -type file -id - FsUnit.Sample -owners - Ray Vernagus, Daniel Mohl, Sergey Tihon, Constantin Tews -authors - Ray Vernagus, Daniel Mohl, Sergey Tihon, Constantin Tews -projectUrl - https://github.com/fsprojects/FsUnit -iconUrl - https://raw.githubusercontent.com/fsprojects/FsUnit/master/docs/img/logo.png -licenseUrl - https://github.com/fsprojects/FsUnit/blob/master/license.txt -requireLicenseAcceptance - false -copyright - Copyright 2015-2025 -tags - F# fsharp NUnit FsUnit -summary - The goals of FsUnit are to make unit-testing feel more functional while leverage existing testing frameworks. -description - FsUnit is a set of extensions that add special testing syntax to NUnit. -dependencies - FsUnit -files - ../../bin/FsUnit.NUnit/**/*.pp ==> content diff --git a/src/FsUnit.Xunit/FsUnit.Xunit.fsproj b/src/FsUnit.Xunit/FsUnit.Xunit.fsproj index a97bfc5c..e731c994 100644 --- a/src/FsUnit.Xunit/FsUnit.Xunit.fsproj +++ b/src/FsUnit.Xunit/FsUnit.Xunit.fsproj @@ -1,7 +1,11 @@  - net8.0;netstandard2.0 + net8.0 FsUnit.Xunit + FsUnit.xUnit + FsUnit is a set of extensions that add special testing syntax to xUnit. + F# fsharp xUnit FsUnit + true Library false @@ -16,12 +20,11 @@ - - - - Always - - + + + + + + - diff --git a/src/FsUnit.Xunit/FsUnitSample.fs.pp b/src/FsUnit.Xunit/FsUnitSample.fs.pp deleted file mode 100644 index b8d34f65..00000000 --- a/src/FsUnit.Xunit/FsUnitSample.fs.pp +++ /dev/null @@ -1,23 +0,0 @@ -namespace $rootnamespace$.Tests - -open Xunit -open FsUnit.Xunit - -type LightBulb(state) = - member x.On = state - override x.ToString() = - match x.On with - | true -> "On" - | false -> "Off" - -type ``Given a LightBulb that has had its state set to true`` ()= - let lightBulb = LightBulb(true) - - [] member __. - ``when I ask whether it is On it answers true.`` ()= - lightBulb.On |> should be True - - [] member __. - ``when I convert it to a string it becomes "On".`` ()= - string lightBulb |> should equal "On" - diff --git a/src/FsUnit.Xunit/paket.references b/src/FsUnit.Xunit/paket.references deleted file mode 100644 index 7249a6f4..00000000 --- a/src/FsUnit.Xunit/paket.references +++ /dev/null @@ -1,3 +0,0 @@ -FSharp.Core -NHamcrest -xunit.v3 \ No newline at end of file diff --git a/src/FsUnit.Xunit/paket.template b/src/FsUnit.Xunit/paket.template deleted file mode 100644 index 1cf5a4b9..00000000 --- a/src/FsUnit.Xunit/paket.template +++ /dev/null @@ -1,32 +0,0 @@ -type file -id - FsUnit.xUnit -owners - Ray Vernagus, Daniel Mohl, Sergey Tihon, Constantin Tews -authors - Ray Vernagus, Daniel Mohl, Sergey Tihon, Constantin Tews -projectUrl - https://github.com/fsprojects/FsUnit -iconUrl - https://raw.githubusercontent.com/fsprojects/FsUnit/master/docs/img/logo.png -licenseUrl - https://raw.githubusercontent.com/fsprojects/FsUnit/master/license.txt -requireLicenseAcceptance - false -copyright - Copyright 2012-2025 -tags - F# fsharp xUnit FsUnit -summary - The goals of FsUnit are to make unit-testing feel more functional while leverage existing testing frameworks. -description - FsUnit is a set of extensions that add special testing syntax to xUnit. -files - ../../bin/FsUnit.Xunit/net8.0/FsUnit.* ==> lib/net8.0 - ../../bin/FsUnit.Xunit/netstandard2.0/FsUnit.* ==> lib/netstandard2.0 - ../../src/install.ps1 ==> tools - -dependencies - xunit.v3 >= LOCKEDVERSION - NHamcrest >= LOCKEDVERSION - FSharp.Core >= LOCKEDVERSION diff --git a/src/FsUnit.Xunit/sample.paket.template b/src/FsUnit.Xunit/sample.paket.template deleted file mode 100644 index 705a3f67..00000000 --- a/src/FsUnit.Xunit/sample.paket.template +++ /dev/null @@ -1,27 +0,0 @@ -type file -id - FsUnit.xUnit.Sample -owners - Ray Vernagus, Daniel Mohl, Sergey Tihon, Constantin Tews -authors - Ray Vernagus, Daniel Mohl, Sergey Tihon, Constantin Tews -projectUrl - https://github.com/fsprojects/FsUnit -iconUrl - https://raw.githubusercontent.com/fsprojects/FsUnit/master/docs/img/logo.png -licenseUrl - https://github.com/fsprojects/FsUnit/blob/master/license.txt -requireLicenseAcceptance - false -copyright - Copyright 2015-2025 -tags - F# fsharp xUnit FsUnit -summary - The goals of FsUnit are to make unit-testing feel more functional while leverage existing testing frameworks. -description - FsUnit is a set of extensions that add special testing syntax to xUnit. -dependencies - FsUnit.xUnit -files - ../../bin/FsUnit.Xunit/**/*.pp ==> content diff --git a/src/install.ps1 b/src/install.ps1 deleted file mode 100644 index faaa23e0..00000000 --- a/src/install.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -param($rootPath, $toolsPath, $package, $project) - -Add-BindingRedirect $project.Name \ No newline at end of file diff --git a/tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj b/tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj index 96494ffb..12fe622f 100644 --- a/tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj +++ b/tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj @@ -39,11 +39,12 @@ - + + + - \ No newline at end of file diff --git a/tests/FsUnit.MsTest.Test/paket.references b/tests/FsUnit.MsTest.Test/paket.references deleted file mode 100644 index 5c561114..00000000 --- a/tests/FsUnit.MsTest.Test/paket.references +++ /dev/null @@ -1,4 +0,0 @@ -FSharp.Core -Microsoft.NET.Test.Sdk -MSTest.TestAdapter -MSTest.TestFramework diff --git a/tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj b/tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj index 28638b24..8569babf 100644 --- a/tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj +++ b/tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj @@ -46,10 +46,12 @@ - + + + + - \ No newline at end of file diff --git a/tests/FsUnit.NUnit.Test/paket.references b/tests/FsUnit.NUnit.Test/paket.references deleted file mode 100644 index cbaf0998..00000000 --- a/tests/FsUnit.NUnit.Test/paket.references +++ /dev/null @@ -1,5 +0,0 @@ -FSharp.Core -Microsoft.NET.Test.Sdk -NUnit -NUnit3TestAdapter -System.Collections.NonGeneric \ No newline at end of file diff --git a/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj b/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj index 0ce5ca7a..770a2295 100644 --- a/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj +++ b/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj @@ -46,10 +46,11 @@ - + + + - diff --git a/tests/FsUnit.Xunit.Test/paket.references b/tests/FsUnit.Xunit.Test/paket.references deleted file mode 100644 index 3217cb9c..00000000 --- a/tests/FsUnit.Xunit.Test/paket.references +++ /dev/null @@ -1,4 +0,0 @@ -FSharp.Core -Microsoft.NET.Test.Sdk -xunit.v3 -xunit.runner.visualstudio \ No newline at end of file From a019313a155ec04d3d1103c1b94d1abd22f1bc2b Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Sun, 11 Oct 2026 08:24:56 +0200 Subject: [PATCH 02/10] Update test framework packages --- Directory.Packages.props | 14 ++++++++------ src/FsUnit.Xunit/FsUnit.Xunit.fsproj | 3 ++- tests/FsUnit.MsTest.Test/beGreaterThanTests.fs | 2 +- tests/FsUnit.MsTest.Test/beSubsetOfTests.fs | 2 +- tests/FsUnit.MsTest.Test/equalTests.fs | 2 +- tests/FsUnit.MsTest.Test/haveLengthTests.fs | 2 +- tests/FsUnit.MsTest.Test/startWithTests.fs | 2 +- tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj | 3 ++- 8 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index aaf6f875..b6142d96 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,14 +5,16 @@ - + - + - - - - + + + + + + diff --git a/src/FsUnit.Xunit/FsUnit.Xunit.fsproj b/src/FsUnit.Xunit/FsUnit.Xunit.fsproj index e731c994..60a4eed1 100644 --- a/src/FsUnit.Xunit/FsUnit.Xunit.fsproj +++ b/src/FsUnit.Xunit/FsUnit.Xunit.fsproj @@ -25,6 +25,7 @@ - + + diff --git a/tests/FsUnit.MsTest.Test/beGreaterThanTests.fs b/tests/FsUnit.MsTest.Test/beGreaterThanTests.fs index 2ad248f1..f5ceb129 100644 --- a/tests/FsUnit.MsTest.Test/beGreaterThanTests.fs +++ b/tests/FsUnit.MsTest.Test/beGreaterThanTests.fs @@ -29,6 +29,6 @@ type ``beGreaterThanTests``() = [] member _.``9.2 should not be greater than 9.2 but message should be equal``() = (fun () -> 9.2 |> should be (greaterThan 9.2)) - |> fun f -> Assert.ThrowsException(f) + |> fun f -> Assert.ThrowsExactly(f) |> fun e -> e.Message |> should equal ("Greater than 9.2 was 9.2") diff --git a/tests/FsUnit.MsTest.Test/beSubsetOfTests.fs b/tests/FsUnit.MsTest.Test/beSubsetOfTests.fs index 8d540977..7e5f5f65 100644 --- a/tests/FsUnit.MsTest.Test/beSubsetOfTests.fs +++ b/tests/FsUnit.MsTest.Test/beSubsetOfTests.fs @@ -41,6 +41,6 @@ type ``beSubsetOfTests``() = [] member _.``11 should not be subset of 1 to 10 but message should be equal``() = (fun () -> [ 11 ] |> should be (subsetOf [ 1..10 ])) - |> fun f -> Assert.ThrowsException(f) + |> fun f -> Assert.ThrowsExactly(f) |> fun e -> e.Message |> should equal ("Is subset of [1; 2; 3; 4; 5; 6; 7; 8; 9; 10] was [11]") diff --git a/tests/FsUnit.MsTest.Test/equalTests.fs b/tests/FsUnit.MsTest.Test/equalTests.fs index cc5ffad8..28777460 100644 --- a/tests/FsUnit.MsTest.Test/equalTests.fs +++ b/tests/FsUnit.MsTest.Test/equalTests.fs @@ -105,7 +105,7 @@ type ``equalTests``() = [] member _.``Ok "foo" should fail on equal Ok "bar" but message should be equal``() = (fun () -> Ok "foo" |> should equal (Ok "bar")) - |> Assert.ThrowsException + |> Assert.ThrowsExactly |> fun e -> e.Message |> should equal ("Equals Ok \"bar\" was Ok \"foo\"") diff --git a/tests/FsUnit.MsTest.Test/haveLengthTests.fs b/tests/FsUnit.MsTest.Test/haveLengthTests.fs index 127df44e..761f4a3c 100644 --- a/tests/FsUnit.MsTest.Test/haveLengthTests.fs +++ b/tests/FsUnit.MsTest.Test/haveLengthTests.fs @@ -43,7 +43,7 @@ type ``haveLengthTests``() = [] member _.``Array with 1 item should fail to have Length 2 but message should be equal``() = (fun () -> [| 1 |] |> should haveLength 2) - |> fun f -> Assert.ThrowsException(f) + |> fun f -> Assert.ThrowsExactly(f) |> fun e -> e.Message |> should equal ("Have Length 2 was [|1|]") diff --git a/tests/FsUnit.MsTest.Test/startWithTests.fs b/tests/FsUnit.MsTest.Test/startWithTests.fs index ba2320ba..4afa82cc 100644 --- a/tests/FsUnit.MsTest.Test/startWithTests.fs +++ b/tests/FsUnit.MsTest.Test/startWithTests.fs @@ -21,6 +21,6 @@ type ``startWithTests``() = [] member _.``ships should not start with ss but message should be equal``() = (fun () -> "ships" |> should startWith "ss") - |> fun f -> Assert.ThrowsException(f) + |> fun f -> Assert.ThrowsExactly(f) |> fun e -> e.Message |> should equal ("ss was \"ships\"") diff --git a/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj b/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj index 770a2295..e17e49e6 100644 --- a/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj +++ b/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj @@ -1,6 +1,7 @@  net8.0 + Exe @@ -50,7 +51,7 @@ - + From c09589310284432ad3071f473300506e43bab45b Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Sun, 11 Oct 2026 08:35:29 +0200 Subject: [PATCH 03/10] fix: pin FSharp.Core --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b6142d96..65ba2a19 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ - + From 1cc3958b04a22881b9a7369ba6e5f87dca944df6 Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Sun, 11 Oct 2026 12:53:23 +0200 Subject: [PATCH 04/10] Remove Central Package Management --- Directory.Packages.props | 20 ------------------- docs/MsTest.fsx | 2 +- docs/index.fsx | 12 +++++------ src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj | 12 +++++------ src/FsUnit.NUnit/FsUnit.NUnit.fsproj | 10 ++++------ src/FsUnit.Xunit/FsUnit.Xunit.fsproj | 12 +++++------ .../FsUnit.MsTest.Test.fsproj | 6 +++--- .../FsUnit.NUnit.Test.fsproj | 8 ++++---- .../FsUnit.Xunit.Test.fsproj | 6 +++--- 9 files changed, 31 insertions(+), 57 deletions(-) delete mode 100644 Directory.Packages.props diff --git a/Directory.Packages.props b/Directory.Packages.props deleted file mode 100644 index 65ba2a19..00000000 --- a/Directory.Packages.props +++ /dev/null @@ -1,20 +0,0 @@ - - - true - - - - - - - - - - - - - - - - - diff --git a/docs/MsTest.fsx b/docs/MsTest.fsx index b9e7262d..654176bf 100644 --- a/docs/MsTest.fsx +++ b/docs/MsTest.fsx @@ -1,7 +1,7 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "../tests/FsUnit.MsTest.Test/bin/Release/net8.0/Microsoft.VisualStudio.TestPlatform.TestFramework.dll" +#r "../tests/FsUnit.MsTest.Test/bin/Release/net8.0/MSTest.TestFramework.dll" #r "../tests/FsUnit.MsTest.Test/bin/Release/net8.0/NHamcrest.dll" #r "../tests/FsUnit.MsTest.Test/bin/Release/net8.0/FsUnit.MsTest.dll" diff --git a/docs/index.fsx b/docs/index.fsx index bd592221..81173ff7 100644 --- a/docs/index.fsx +++ b/docs/index.fsx @@ -161,12 +161,12 @@ Supplying an expression that will result in a non-union type as well as supplyin *) type TestUnion = First | Second of int | Third of string -First |> should be (ofCase<@ First @>) -First |> should be (ofCase<@ First, Second @>) // checks if on the cases matches the given case -Second 5 |> should be (ofCase<@ Second 10 @>) // note, the actual value is not checked! -First |> should not' (be ofCase<@ Second 5 @>) -5 |> should be (ofCase<@ Second 5 @>) // will throw an exception -Second 5 |> should be (ofCase<@ int @>) // will throw an exception +First |> should be (ofCase <@ First @>) +First |> should be (ofCase <@ First, Second @>) // checks if on the cases matches the given case +Second 5 |> should be (ofCase <@ Second 10 @>) // note, the actual value is not checked! +First |> should not' (be ofCase <@ Second 5 @>) +5 |> should be (ofCase <@ Second 5 @>) // will throw an exception +Second 5 |> should be (ofCase <@ int @>) // will throw an exception (** diff --git a/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj b/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj index f061c0fd..b2d41a3f 100644 --- a/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj +++ b/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj @@ -7,9 +7,7 @@ F# fsharp MsTest FsUnit Library false - - - false + true @@ -23,8 +21,8 @@ - - - + + + - \ No newline at end of file + diff --git a/src/FsUnit.NUnit/FsUnit.NUnit.fsproj b/src/FsUnit.NUnit/FsUnit.NUnit.fsproj index 2f371092..d6330399 100644 --- a/src/FsUnit.NUnit/FsUnit.NUnit.fsproj +++ b/src/FsUnit.NUnit/FsUnit.NUnit.fsproj @@ -8,9 +8,7 @@ Library false true - - - false + true @@ -25,7 +23,7 @@ - - + + - \ No newline at end of file + diff --git a/src/FsUnit.Xunit/FsUnit.Xunit.fsproj b/src/FsUnit.Xunit/FsUnit.Xunit.fsproj index 60a4eed1..8267e7bd 100644 --- a/src/FsUnit.Xunit/FsUnit.Xunit.fsproj +++ b/src/FsUnit.Xunit/FsUnit.Xunit.fsproj @@ -8,9 +8,7 @@ true Library false - - - true + true @@ -23,9 +21,9 @@ - - - - + + + + diff --git a/tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj b/tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj index 12fe622f..2918560b 100644 --- a/tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj +++ b/tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj @@ -43,8 +43,8 @@ - - - + + + \ No newline at end of file diff --git a/tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj b/tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj index 8569babf..3926aad8 100644 --- a/tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj +++ b/tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj @@ -49,9 +49,9 @@ - - - - + + + + \ No newline at end of file diff --git a/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj b/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj index e17e49e6..ee147c9b 100644 --- a/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj +++ b/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj @@ -50,8 +50,8 @@ - - - + + + From 00a8bc9039f38dfb86bac3a796d1aa92a5ccda41 Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Mon, 12 Oct 2026 14:25:06 +0200 Subject: [PATCH 05/10] fix: cleanup --- build/build.fsproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/build/build.fsproj b/build/build.fsproj index 117a44ec..d4505641 100644 --- a/build/build.fsproj +++ b/build/build.fsproj @@ -2,8 +2,6 @@ Exe net8.0 - - false From 951606d83f63eb519ab2ac91879d4c687d1fab60 Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Mon, 12 Oct 2026 15:11:55 +0200 Subject: [PATCH 06/10] Migrate xUnit tests to MTP v2 --- build/build.fs | 2 +- tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build/build.fs b/build/build.fs index ceb87ffd..a438b3d6 100644 --- a/build/build.fs +++ b/build/build.fs @@ -151,7 +151,7 @@ Target.create "NUnit" (fun _ -> failwithf $"NUnit test failed: %A{result.Errors}") Target.create "xUnit" (fun _ -> - let result = DotNet.exec id "test" "tests/FsUnit.Xunit.Test/" + let result = DotNet.exec id "run" "--project tests/FsUnit.Xunit.Test/" if not result.OK then failwithf $"xUnit test failed: %A{result.Errors}") diff --git a/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj b/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj index ee147c9b..6ef0635a 100644 --- a/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj +++ b/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj @@ -2,6 +2,7 @@ net8.0 Exe + true @@ -50,8 +51,6 @@ - - - + From 48d76e92c4416a87caed7bba0fcde6c1c1861dd0 Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Mon, 12 Oct 2026 15:18:59 +0200 Subject: [PATCH 07/10] Move all test suites to MTP v2 --- build/build.fs | 2 +- global.json | 3 +++ tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj | 4 ++-- tests/FsUnit.MsTest.Test/MSTest.runsettings | 6 ------ tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj | 3 ++- 5 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 tests/FsUnit.MsTest.Test/MSTest.runsettings diff --git a/build/build.fs b/build/build.fs index a438b3d6..ceb87ffd 100644 --- a/build/build.fs +++ b/build/build.fs @@ -151,7 +151,7 @@ Target.create "NUnit" (fun _ -> failwithf $"NUnit test failed: %A{result.Errors}") Target.create "xUnit" (fun _ -> - let result = DotNet.exec id "run" "--project tests/FsUnit.Xunit.Test/" + let result = DotNet.exec id "test" "tests/FsUnit.Xunit.Test/" if not result.OK then failwithf $"xUnit test failed: %A{result.Errors}") diff --git a/global.json b/global.json index ca621bcb..2bd643db 100644 --- a/global.json +++ b/global.json @@ -2,5 +2,8 @@ "sdk": { "version": "10.0.401", "rollForward": "latestPatch" + }, + "test": { + "runner": "Microsoft.Testing.Platform" } } \ No newline at end of file diff --git a/tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj b/tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj index 2918560b..f3b811fe 100644 --- a/tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj +++ b/tests/FsUnit.MsTest.Test/FsUnit.MsTest.Test.fsproj @@ -3,6 +3,8 @@ net8.0 true + Exe + true @@ -39,11 +41,9 @@ - - diff --git a/tests/FsUnit.MsTest.Test/MSTest.runsettings b/tests/FsUnit.MsTest.Test/MSTest.runsettings deleted file mode 100644 index 4bfe1ac4..00000000 --- a/tests/FsUnit.MsTest.Test/MSTest.runsettings +++ /dev/null @@ -1,6 +0,0 @@ - - - - true - - diff --git a/tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj b/tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj index 3926aad8..ef82b45f 100644 --- a/tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj +++ b/tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj @@ -1,6 +1,8 @@  net8.0 + Exe + true false @@ -49,7 +51,6 @@ - From 4629c15bd4cd80df4fb10facc93dc75f288810aa Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Mon, 12 Oct 2026 18:24:44 +0200 Subject: [PATCH 08/10] fix: FSharp.Core package deps --- src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj | 2 +- src/FsUnit.NUnit/FsUnit.NUnit.fsproj | 2 +- src/FsUnit.Xunit/FsUnit.Xunit.fsproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj b/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj index b2d41a3f..0cfd7f3b 100644 --- a/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj +++ b/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj @@ -21,7 +21,7 @@ - + diff --git a/src/FsUnit.NUnit/FsUnit.NUnit.fsproj b/src/FsUnit.NUnit/FsUnit.NUnit.fsproj index d6330399..dfb0b30e 100644 --- a/src/FsUnit.NUnit/FsUnit.NUnit.fsproj +++ b/src/FsUnit.NUnit/FsUnit.NUnit.fsproj @@ -23,7 +23,7 @@ - + diff --git a/src/FsUnit.Xunit/FsUnit.Xunit.fsproj b/src/FsUnit.Xunit/FsUnit.Xunit.fsproj index 8267e7bd..3c2dd1b6 100644 --- a/src/FsUnit.Xunit/FsUnit.Xunit.fsproj +++ b/src/FsUnit.Xunit/FsUnit.Xunit.fsproj @@ -21,7 +21,7 @@ - + From fc8d4d48f23167e689953a7c1c343613bfd2c9ea Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Mon, 12 Oct 2026 20:34:05 +0200 Subject: [PATCH 09/10] Restore .NET Framework target support --- RELEASE_NOTES.md | 1 + src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj | 2 +- src/FsUnit.NUnit/FsUnit.NUnit.fsproj | 2 +- src/FsUnit.NUnit/FsUnit.fs | 6 +++--- src/FsUnit.NUnit/FsUnitTyped.fs | 2 +- src/FsUnit.Xunit/FsUnit.Xunit.fsproj | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 91021c49..02eccc26 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,4 +1,5 @@ ### 7.1.1.0 - Jun 26, 2025 +- Restore netstandard2.0 target for FsUnit.xUnit and Fs30Unit.MsTest; add net462 target for FsUnit (NUnit) (.NET Framework support) - Add `equivalent` assertion to FsUnit.Xunit. - (https://github.com/fsprojects/FsUnit/pull/305) ### 7.0.1.0 - Dec 30, 2024 diff --git a/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj b/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj index 0cfd7f3b..bcff2605 100644 --- a/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj +++ b/src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj @@ -1,6 +1,6 @@  - net8.0 + net8.0;netstandard2.0 FsUnit.MsTest Fs30Unit.MsTest FsUnit is a set of extensions that add special testing syntax to MsTest. diff --git a/src/FsUnit.NUnit/FsUnit.NUnit.fsproj b/src/FsUnit.NUnit/FsUnit.NUnit.fsproj index dfb0b30e..ab92ef3b 100644 --- a/src/FsUnit.NUnit/FsUnit.NUnit.fsproj +++ b/src/FsUnit.NUnit/FsUnit.NUnit.fsproj @@ -1,6 +1,6 @@  - net8.0 + net8.0;net462 FsUnit.NUnit FsUnit FsUnit is a set of extensions that add special testing syntax to NUnit. diff --git a/src/FsUnit.NUnit/FsUnit.fs b/src/FsUnit.NUnit/FsUnit.fs index 35dcece6..b3922b03 100644 --- a/src/FsUnit.NUnit/FsUnit.fs +++ b/src/FsUnit.NUnit/FsUnit.fs @@ -34,8 +34,8 @@ module TopLevelOperators = let y = match actual with - | :? (unit -> unit) as testFunc -> box(System.Action(testFunc)) - | :? (unit -> obj) as testFunc -> box(System.Action(testFunc >> ignore)) + | :? (unit -> unit) as testFunc -> box(new System.Action(testFunc)) + | :? (unit -> obj) as testFunc -> box(new System.Action(testFunc >> ignore)) | _ -> actual if isNull(box expression) then @@ -87,7 +87,7 @@ module TopLevelOperators = LessThanOrEqualConstraint(expected) let shouldFail(f: unit -> unit) = - System.Action(f) |> should throw typeof + new System.Action(f) |> should throw typeof let endWith(expected: string) = EndsWithConstraint expected diff --git a/src/FsUnit.NUnit/FsUnitTyped.fs b/src/FsUnit.NUnit/FsUnitTyped.fs index 8b225804..8a42f87f 100644 --- a/src/FsUnit.NUnit/FsUnitTyped.fs +++ b/src/FsUnit.NUnit/FsUnitTyped.fs @@ -36,7 +36,7 @@ module TopLevelOperators = [] let shouldFail<'exn when 'exn :> exn>(f: unit -> unit) = - Assert.Throws(Is.InstanceOf<'exn>(), System.Action(f)) |> ignore + Assert.Throws(Is.InstanceOf<'exn>(), new System.Action(f)) |> ignore [] let shouldContainText (expected: string) (actual: string) = diff --git a/src/FsUnit.Xunit/FsUnit.Xunit.fsproj b/src/FsUnit.Xunit/FsUnit.Xunit.fsproj index 3c2dd1b6..bd5022c8 100644 --- a/src/FsUnit.Xunit/FsUnit.Xunit.fsproj +++ b/src/FsUnit.Xunit/FsUnit.Xunit.fsproj @@ -1,6 +1,6 @@  - net8.0 + net8.0;netstandard2.0 FsUnit.Xunit FsUnit.xUnit FsUnit is a set of extensions that add special testing syntax to xUnit. From 13b6db1adb71d3f618262b303fb100c065e1e821 Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Mon, 12 Oct 2026 20:36:24 +0200 Subject: [PATCH 10/10] fix: revert notes changes --- RELEASE_NOTES.md | 1 - 1 file changed, 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 02eccc26..91021c49 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,4 @@ ### 7.1.1.0 - Jun 26, 2025 -- Restore netstandard2.0 target for FsUnit.xUnit and Fs30Unit.MsTest; add net462 target for FsUnit (NUnit) (.NET Framework support) - Add `equivalent` assertion to FsUnit.Xunit. - (https://github.com/fsprojects/FsUnit/pull/305) ### 7.0.1.0 - Dec 30, 2024