From b859378d2303ad740e6fd879310c70de8416e26e Mon Sep 17 00:00:00 2001 From: Steven Giesel Date: Sat, 2 Mar 2024 17:02:11 +0100 Subject: [PATCH] feat: Added support for net9.0 (#1404) * feat: Added support for net9.0 * ci: include .net 9 sdk in workflow * chore: replace verfication file reference in solution with ci. * note about .net 9 support in v1 --------- Co-authored-by: Egil Hansen --- .github/workflows/ci.yml | 3 +++ .github/workflows/docs-deploy.yml | 1 + .github/workflows/release.yml | 1 + CHANGELOG.md | 1 + Directory.Build.props | 1 + bunit.sln | 4 ++-- global.json | 2 +- src/bunit.core/bunit.core.csproj | 12 +++++++++--- src/bunit.web.query/bunit.web.query.csproj | 10 ++++++++-- .../Implementation/BunitJSObjectReference.cs | 5 ++++- .../JSInterop/Implementation/BunitJSRuntime.net5.cs | 2 +- src/bunit.web/JSInterop/JSRuntimeInvocation.cs | 1 + src/bunit.web/bunit.web.csproj | 13 ++++++++++++- src/bunit/bunit.csproj | 6 +++--- tests/bunit.core.tests/bunit.core.tests.csproj | 2 +- tests/bunit.testassets/bunit.testassets.csproj | 8 +++++++- .../bunit.web.query.tests.csproj | 2 +- .../JSInterop/BunitJSInteropTest.net5.cs | 2 +- .../JSInterop/BunitJSObjectReferenceTest.cs | 8 ++++++-- tests/bunit.web.tests/bunit.web.tests.csproj | 2 +- 20 files changed, 65 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a80cc4156..54d6979c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,7 @@ jobs: 6.0.x 7.0.x 8.0.x + 9.0.x - name: โš™๏ธ Setup GIT versioning uses: dotnet/nbgv@v0.4.2 @@ -132,6 +133,7 @@ jobs: 6.0.x 7.0.x 8.0.x + 9.0.x - name: ๐Ÿงช Run unit tests run: dotnet test -c release --blame --blame-crash --blame-hang @@ -209,6 +211,7 @@ jobs: 6.0.x 7.0.x 8.0.x + 9.0.x - name: โš™๏ธ Setup GIT versioning uses: dotnet/nbgv@v0.4.2 diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml index 15d36e299..f4b361a34 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/docs-deploy.yml @@ -77,6 +77,7 @@ jobs: 6.0.x 7.0.x 8.0.x + 9.0.x - name: ๐ŸŽจ Setup color run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 783d43855..9fd8108cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,6 +62,7 @@ jobs: 6.0.x 7.0.x 8.0.x + 9.0.x - name: ๐Ÿ› ๏ธ Update changelog uses: thomaseizinger/keep-a-changelog-new-release@2.0.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 10396a984..df93341ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to **bUnit** will be documented in this file. The project ad ### Added - Support for `IKeyedServiceProvider` in net8.0. Reported by [@ViRuSTriNiTy](https://github.com/ViRuSTriNiTy). By [@linkdotnet](https://github.com/linkdotnet). +- Support for `net9.0`. NOTE, there is no commitment as of now to support net9.0 in bUnit v1. However. Support for net9.0 may move to a future v2 release of bUnit and be deprecated in v1. However, allowing bUnit to build and work with net9.0 previews allows our users to keep testing! ### Fixed - Support for `SupplyFromQueryParameter` in net8.0. Reported by [@aayjaychan](https://github.com/aayjaychan). Fixed by [@egil](https://github.com/egil) and [@linkdotnet](https://github.com/linkdotnet). diff --git a/Directory.Build.props b/Directory.Build.props index 183f74e64..09f9fb2ef 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,6 +7,7 @@ 6.0.* 7.0.* 8.0.* + 9.0.0-* diff --git a/bunit.sln b/bunit.sln index e97a9e7c6..89b8e8094 100644 --- a/bunit.sln +++ b/bunit.sln @@ -48,11 +48,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.testassets", "tests\b EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".workflows", ".workflows", "{3B2F3419-5336-4147-A212-E19091195203}" ProjectSection(SolutionItems) = preProject + .github\workflows\ci.yml = .github\workflows\ci.yml .github\workflows\docs-deploy.yml = .github\workflows\docs-deploy.yml .github\workflows\prepare-release.yml = .github\workflows\prepare-release.yml .github\workflows\release-preview.yml = .github\workflows\release-preview.yml .github\workflows\release.yml = .github\workflows\release.yml - .github\workflows\verification.yml = .github\workflows\verification.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmark", "benchmark", "{F6084D31-2A92-4794-A47E-A8F2254E6970}" @@ -72,7 +72,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.generators.internal", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.generators.tests", "tests\bunit.generators.tests\bunit.generators.tests.csproj", "{09046981-D9EC-4295-8502-721AC54E1F12}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bunit.generators", "src\bunit.generators\bunit.generators.csproj", "{A7C6A2AA-FF8F-4ED1-8590-5324FC566059}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.generators", "src\bunit.generators\bunit.generators.csproj", "{A7C6A2AA-FF8F-4ED1-8590-5324FC566059}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/global.json b/global.json index 18562b58c..83105ca8e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { "rollForward": "latestMajor", - "allowPrerelease": false + "allowPrerelease": true } } diff --git a/src/bunit.core/bunit.core.csproj b/src/bunit.core/bunit.core.csproj index a65412011..e1e8b2818 100644 --- a/src/bunit.core/bunit.core.csproj +++ b/src/bunit.core/bunit.core.csproj @@ -1,11 +1,11 @@ - netstandard2.1;net5.0;net6.0;net7.0;net8.0 + netstandard2.1;net5.0;net6.0;net7.0;net8.0;net9.0 Bunit Bunit.Core - + bunit.core bUnit.core @@ -44,4 +44,10 @@ - \ No newline at end of file + + + + + + + diff --git a/src/bunit.web.query/bunit.web.query.csproj b/src/bunit.web.query/bunit.web.query.csproj index 51b813572..46f303535 100644 --- a/src/bunit.web.query/bunit.web.query.csproj +++ b/src/bunit.web.query/bunit.web.query.csproj @@ -1,7 +1,7 @@ - netstandard2.1;net5.0;net6.0;net7.0;net8.0 + netstandard2.1;net5.0;net6.0;net7.0;net8.0;net9.0 Bunit Bunit.Web.Query @@ -44,4 +44,10 @@ - \ No newline at end of file + + + + + + + diff --git a/src/bunit.web/JSInterop/Implementation/BunitJSObjectReference.cs b/src/bunit.web/JSInterop/Implementation/BunitJSObjectReference.cs index b0ee62734..49ab896a1 100644 --- a/src/bunit.web/JSInterop/Implementation/BunitJSObjectReference.cs +++ b/src/bunit.web/JSInterop/Implementation/BunitJSObjectReference.cs @@ -9,7 +9,10 @@ namespace Bunit; [SuppressMessage("Minor Code Smell", "S1939:Inheritance list should not be redundant", Justification = "By design. To make it obvious that both is implemented.")] -internal sealed class BunitJSObjectReference : IJSObjectReference, IJSInProcessObjectReference, IJSUnmarshalledObjectReference +internal sealed class BunitJSObjectReference : IJSObjectReference, IJSInProcessObjectReference +#if !NET9_0_OR_GREATER + , IJSUnmarshalledObjectReference +#endif { private BunitJSInterop JSInterop { get; } diff --git a/src/bunit.web/JSInterop/Implementation/BunitJSRuntime.net5.cs b/src/bunit.web/JSInterop/Implementation/BunitJSRuntime.net5.cs index 0dcc0303c..f2f466d58 100644 --- a/src/bunit.web/JSInterop/Implementation/BunitJSRuntime.net5.cs +++ b/src/bunit.web/JSInterop/Implementation/BunitJSRuntime.net5.cs @@ -1,4 +1,4 @@ -#if NET5_0_OR_GREATER +#if NET5_0_OR_GREATER && !NET9_0_OR_GREATER using System; using Bunit.JSInterop.Implementation; using Microsoft.JSInterop; diff --git a/src/bunit.web/JSInterop/JSRuntimeInvocation.cs b/src/bunit.web/JSInterop/JSRuntimeInvocation.cs index c3deb91a5..d30350a2d 100644 --- a/src/bunit.web/JSInterop/JSRuntimeInvocation.cs +++ b/src/bunit.web/JSInterop/JSRuntimeInvocation.cs @@ -3,6 +3,7 @@ namespace Bunit; /// /// Represents an invocation of JavaScript via the JSRuntime Mock. /// +[Serializable] public readonly struct JSRuntimeInvocation : IEquatable { /// diff --git a/src/bunit.web/bunit.web.csproj b/src/bunit.web/bunit.web.csproj index 10f9fe0c3..67a137951 100644 --- a/src/bunit.web/bunit.web.csproj +++ b/src/bunit.web/bunit.web.csproj @@ -1,7 +1,7 @@ - netstandard2.1;net5.0;net6.0;net7.0;net8.0 + netstandard2.1;net5.0;net6.0;net7.0;net8.0;net9.0 Bunit Bunit.Web