Skip to content

Commit d5decbf

Browse files
authored
Added .NET 9 to test matrix (#848)
* Added .NET 9 to test matrix * Update changelog
1 parent 8538ea0 commit d5decbf

File tree

9 files changed

+21
-22
lines changed

9 files changed

+21
-22
lines changed

.github/workflows/release_documentation.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ jobs:
1212
- name: Setup .NET
1313
uses: actions/setup-dotnet@v4
1414
with:
15-
dotnet-version: |
16-
8.0.x
15+
dotnet-version: 9.0.x
1716

1817
- name: Setup Ruby for documentation build
1918
uses: ruby/setup-ruby@v1

.github/workflows/release_packages.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ jobs:
1212
- name: Setup .NET
1313
uses: actions/setup-dotnet@v4
1414
with:
15-
dotnet-version: |
16-
8.0.x
15+
dotnet-version: 9.0.x
1716

1817
- name: Build package
1918
run: dotnet pack src/NSubstitute/NSubstitute.csproj -p:CI=true

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [windows-latest, ubuntu-latest, macOS-latest]
13-
framework: [net8.0]
13+
framework: [net9.0, net8.0]
1414
include:
1515
- os: windows-latest
1616
framework: net462
@@ -24,6 +24,7 @@ jobs:
2424
uses: actions/setup-dotnet@v4
2525
with:
2626
dotnet-version: |
27+
9.0.x
2728
8.0.x
2829
2930
- name: Build
@@ -42,6 +43,7 @@ jobs:
4243
uses: actions/setup-dotnet@v4
4344
with:
4445
dotnet-version: |
46+
9.0.x
4547
8.0.x
4648
4749
# used for documentation
@@ -63,7 +65,7 @@ jobs:
6365
- name: Setup .NET
6466
uses: actions/setup-dotnet@v4
6567
with:
66-
dotnet-version: 8.0.x
68+
dotnet-version: 9.0.x
6769

6870
- name: Format
6971
run: dotnet format --verify-no-changes

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* [UPDATE] Update github actions steps versions
66
* [UPDATE] Remove legacy obsolete API
77
* [UPDATE] Mark as obsolete api CompatArg with pre c# 7.0 support
8-
8+
* [NEW] Added .NET 9 to test matrix
99

1010
### 5.3.0 (October 2024)
1111

build/build.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
open System
22
open System.Diagnostics
33
open System.IO
4-
open System.Text.RegularExpressions
54

65
open Fake.Core
76
open Fake.Core.TargetOperators
@@ -17,7 +16,7 @@ let description = Target.description
1716

1817
module FileReaderWriter =
1918
let Read file = File.ReadAllText(file)
20-
let Write file text = File.WriteAllText(file, text)
19+
let Write file (text: string) = File.WriteAllText(file, text)
2120
let TransformFile file target (f : string -> string) =
2221
Read file
2322
|> f

build/build.fsproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<OutputType>Exe</OutputType>
66
<OutputPath>buildOutput</OutputPath>
77
</PropertyGroup>
@@ -14,9 +14,9 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.Build" Version="17.9.5" />
18-
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.9.5" />
19-
<PackageReference Include="MSBuild.StructuredLogger" Version="2.2.374" />
17+
<PackageReference Include="Microsoft.Build" Version="17.12.6" />
18+
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.12.6" />
19+
<PackageReference Include="MSBuild.StructuredLogger" Version="2.2.386" />
2020
<PackageReference Include="Fake.DotNet.Cli" Version="6.1.3" />
2121
<PackageReference Include="Fake.Core.Target" Version="6.1.3" />
2222
</ItemGroup>

src/NSubstitute/Core/ThreadLocalContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class ThreadLocalContext : IThreadLocalContext
1919
public ThreadLocalContext()
2020
{
2121
_lastCallRouter = new RobustThreadLocal<ICallRouter?>();
22-
_argumentSpecifications = new RobustThreadLocal<IList<IArgumentSpecification>>(() => new List<IArgumentSpecification>());
22+
_argumentSpecifications = new RobustThreadLocal<IList<IArgumentSpecification>>(() => []);
2323
_getArgumentsForRaisingEvent = new RobustThreadLocal<Func<ICall, object?[]>?>();
2424
_currentQuery = new RobustThreadLocal<IQuery?>();
2525
_pendingSpecificationInfo = new RobustThreadLocal<PendingSpecInfoData>();
@@ -102,7 +102,7 @@ public IList<IArgumentSpecification> DequeueAllArgumentSpecifications()
102102
}
103103
else
104104
{
105-
_argumentSpecifications.Value = new List<IArgumentSpecification>();
105+
_argumentSpecifications.Value = [];
106106
}
107107

108108
return queue;

tests/NSubstitute.Acceptance.Specs/FormattingCallsWhenThrowingReceivedCallsExceptions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public class When_no_calls_are_made_to_the_expected_member : Context
2121
{
2222
protected override void ConfigureContext()
2323
{
24-
Sample.AnotherMethod(new List<string>());
25-
Sample.AnotherMethod(new List<string>());
24+
Sample.AnotherMethod([]);
25+
Sample.AnotherMethod([]);
2626
}
2727

2828
protected override void ExpectedCall()
@@ -67,12 +67,12 @@ public void Should_report_non_matching_calls()
6767

6868
public class When_calls_have_been_made_to_expected_member_but_with_some_different_args : Context
6969
{
70-
readonly IList<string> _strings = new List<string> { "a", "b" };
70+
readonly IList<string> _strings = ["a", "b"];
7171

7272
protected override void ConfigureContext()
7373
{
74-
Sample.SampleMethod("different", 1, new List<string>());
75-
Sample.SampleMethod("string", 7, new List<string>());
74+
Sample.SampleMethod("different", 1, []);
75+
Sample.SampleMethod("string", 7, []);
7676
}
7777

7878
protected override void ExpectedCall()

tests/NSubstitute.Acceptance.Specs/NSubstitute.Acceptance.Specs.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net462</TargetFrameworks>
4+
<TargetFrameworks>net9.0;net8.0;net462</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>
88
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
1010
<PackageReference Include="NUnit" Version="4.2.2" />
1111
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
1212
</ItemGroup>

0 commit comments

Comments
 (0)