Skip to content

Commit

Permalink
Added .NET 9 to test matrix (#848)
Browse files Browse the repository at this point in the history
* Added .NET 9 to test matrix

* Update changelog
  • Loading branch information
Romfos authored Nov 30, 2024
1 parent 8538ea0 commit d5decbf
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 22 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/release_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
dotnet-version: 9.0.x

- name: Setup Ruby for documentation build
uses: ruby/setup-ruby@v1
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
dotnet-version: 9.0.x

- name: Build package
run: dotnet pack src/NSubstitute/NSubstitute.csproj -p:CI=true
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macOS-latest]
framework: [net8.0]
framework: [net9.0, net8.0]
include:
- os: windows-latest
framework: net462
Expand All @@ -24,6 +24,7 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
8.0.x
- name: Build
Expand All @@ -42,6 +43,7 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
8.0.x
# used for documentation
Expand All @@ -63,7 +65,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- name: Format
run: dotnet format --verify-no-changes
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* [UPDATE] Update github actions steps versions
* [UPDATE] Remove legacy obsolete API
* [UPDATE] Mark as obsolete api CompatArg with pre c# 7.0 support

* [NEW] Added .NET 9 to test matrix

### 5.3.0 (October 2024)

Expand Down
3 changes: 1 addition & 2 deletions build/build.fs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
open System
open System.Diagnostics
open System.IO
open System.Text.RegularExpressions

open Fake.Core
open Fake.Core.TargetOperators
Expand All @@ -17,7 +16,7 @@ let description = Target.description

module FileReaderWriter =
let Read file = File.ReadAllText(file)
let Write file text = File.WriteAllText(file, text)
let Write file (text: string) = File.WriteAllText(file, text)
let TransformFile file target (f : string -> string) =
Read file
|> f
Expand Down
8 changes: 4 additions & 4 deletions build/build.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<OutputType>Exe</OutputType>
<OutputPath>buildOutput</OutputPath>
</PropertyGroup>
Expand All @@ -14,9 +14,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="17.9.5" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.9.5" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.2.374" />
<PackageReference Include="Microsoft.Build" Version="17.12.6" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.12.6" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.2.386" />
<PackageReference Include="Fake.DotNet.Cli" Version="6.1.3" />
<PackageReference Include="Fake.Core.Target" Version="6.1.3" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/NSubstitute/Core/ThreadLocalContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ThreadLocalContext : IThreadLocalContext
public ThreadLocalContext()
{
_lastCallRouter = new RobustThreadLocal<ICallRouter?>();
_argumentSpecifications = new RobustThreadLocal<IList<IArgumentSpecification>>(() => new List<IArgumentSpecification>());
_argumentSpecifications = new RobustThreadLocal<IList<IArgumentSpecification>>(() => []);
_getArgumentsForRaisingEvent = new RobustThreadLocal<Func<ICall, object?[]>?>();
_currentQuery = new RobustThreadLocal<IQuery?>();
_pendingSpecificationInfo = new RobustThreadLocal<PendingSpecInfoData>();
Expand Down Expand Up @@ -102,7 +102,7 @@ public IList<IArgumentSpecification> DequeueAllArgumentSpecifications()
}
else
{
_argumentSpecifications.Value = new List<IArgumentSpecification>();
_argumentSpecifications.Value = [];
}

return queue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class When_no_calls_are_made_to_the_expected_member : Context
{
protected override void ConfigureContext()
{
Sample.AnotherMethod(new List<string>());
Sample.AnotherMethod(new List<string>());
Sample.AnotherMethod([]);
Sample.AnotherMethod([]);
}

protected override void ExpectedCall()
Expand Down Expand Up @@ -67,12 +67,12 @@ public void Should_report_non_matching_calls()

public class When_calls_have_been_made_to_expected_member_but_with_some_different_args : Context
{
readonly IList<string> _strings = new List<string> { "a", "b" };
readonly IList<string> _strings = ["a", "b"];

protected override void ConfigureContext()
{
Sample.SampleMethod("different", 1, new List<string>());
Sample.SampleMethod("string", 7, new List<string>());
Sample.SampleMethod("different", 1, []);
Sample.SampleMethod("string", 7, []);
}

protected override void ExpectedCall()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net462</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net462</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
</ItemGroup>
Expand Down

0 comments on commit d5decbf

Please sign in to comment.