Skip to content

Commit 3ce2d66

Browse files
authored
Added .NET 8 to test platforms (#756)
* Added .NET 8 to test platforms * Fix some build warnings * Update some test dependencies for docs
1 parent a32dc4e commit 3ce2d66

14 files changed

+44
-43
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trim_trailing_whitespace = true
77
indent_size = 4
88
indent_style = space
99

10-
[*.{sln,csproj,yml}]
10+
[*.{sln,csproj,fsproj,yml}]
1111
indent_size = 2
1212
indent_style = space
1313

.github/workflows/build_and_test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
matrix:
88
os: [windows-latest, ubuntu-latest, macOS-latest]
9-
framework: [net6.0, net7.0]
9+
framework: [net6.0, net7.0, net8.0]
1010
include:
1111
- os: windows-latest
1212
framework: net462
@@ -22,6 +22,7 @@ jobs:
2222
dotnet-version: |
2323
6.0.x
2424
7.0.x
25+
8.0.x
2526
2627
- name: Build
2728
run: dotnet build
@@ -43,6 +44,7 @@ jobs:
4344
dotnet-version: |
4445
6.0.x
4546
7.0.x
47+
8.0.x
4648
4749
# used for documentation
4850
- name: Setup Ruby

NSubstitute.sln

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
21
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26730.16
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.8.34309.116
54
MinimumVisualStudioVersion = 10.0.40219.1
65
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSubstitute", "src\NSubstitute\NSubstitute.csproj", "{F59BF5FC-52D8-492E-BDE8-244C183B4C92}"
76
EndProject
@@ -11,11 +10,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0E2B9095
1110
EndProject
1211
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{A8AF7D01-6CE4-47B2-9E23-689A53991C3D}"
1312
ProjectSection(SolutionItems) = preProject
14-
build\build.fsx = build\build.fsx
15-
build\build.sh = build\build.sh
16-
build\ExtractDocs.fsx = build\ExtractDocs.fsx
17-
build\packages.config = build\packages.config
1813
build\build.cmd = build\build.cmd
14+
build\build.fs = build\build.fs
15+
build\build.sh = build\build.sh
16+
build\ExtractDocs.fs = build\ExtractDocs.fs
1917
EndProjectSection
2018
EndProject
2119
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CA2DD4AA-8DCD-42FB-8081-243281AD2956}"

build/build.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ let initTargets() =
161161
<LangVersion>latest</LangVersion>
162162
</PropertyGroup>
163163
<ItemGroup>
164-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
165-
<PackageReference Include="NUnit" Version="3.13.3" />
166-
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
164+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
165+
<PackageReference Include="NUnit" Version="3.14.0" />
166+
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
167167
</ItemGroup>
168168
<ItemGroup>
169169
<ProjectReference Include="..\..\..\src\NSubstitute\NSubstitute.csproj" />

build/build.fsproj

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

33
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
54
<TargetFramework>net6.0</TargetFramework>
5+
<OutputType>Exe</OutputType>
66
<OutputPath>buildOutput</OutputPath>
77
</PropertyGroup>
88

99
<ItemGroup>
10+
<None Include="build.cmd" />
11+
<None Include="build.sh" />
1012
<Compile Include="ExtractDocs.fs" />
1113
<Compile Include="build.fs" />
1214
</ItemGroup>
@@ -21,4 +23,5 @@
2123
<PackageReference Include="Fake.Tools.Git" Version="6.0.0" />
2224
<PackageReference Include="Fake.Core.Target" Version="6.0.0" />
2325
</ItemGroup>
26+
2427
</Project>

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

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

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

77
<ItemGroup>
88
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
10-
<PackageReference Include="NUnit" Version="3.13.3" />
11-
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
10+
<PackageReference Include="NUnit" Version="3.14.0" />
11+
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
1212
</ItemGroup>
1313

1414
<ItemGroup Condition="'$(TargetIsNetFx)' == 'true'">

tests/NSubstitute.Benchmarks/ActivationBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace NSubstitute.Benchmarks
55
{
6-
[ClrJob, CoreJob]
6+
[SimpleJob]
77
[MemoryDiagnoser]
88
public class ActivationBenchmark
99
{

tests/NSubstitute.Benchmarks/ArgumentSpecificationUsageBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace NSubstitute.Benchmarks
55
{
6-
[ClrJob, CoreJob]
6+
[SimpleJob]
77
[MemoryDiagnoser]
88
public class ArgumentSpecificationUsageBenchmark
99
{

tests/NSubstitute.Benchmarks/DispatchConfiguredMatchingCallBenchmark.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace NSubstitute.Benchmarks
55
{
6-
[ClrJob, CoreJob]
6+
[SimpleJob]
77
[MemoryDiagnoser]
88
public class DispatchConfiguredMatchingCallBenchmark
99
{
@@ -17,26 +17,26 @@ public DispatchConfiguredMatchingCallBenchmark()
1717
{
1818
_interfaceProxy = Substitute.For<IInterfaceWithSingleMethod>();
1919
_interfaceProxy.IntMethod("42").Returns(42);
20-
_interfaceProxy.When(x => x.VoidMethod("42")).Do(delegate { });
21-
20+
_interfaceProxy.When(x => x.VoidMethod("42")).Do(delegate { });
21+
2222
_abstractClassProxy = Substitute.For<AbstractClassWithSingleMethod>();
2323
_abstractClassProxy.IntMethod("42").Returns(42);
24-
_abstractClassProxy.When(x => x.VoidMethod("42")).Do(delegate { });
25-
24+
_abstractClassProxy.When(x => x.VoidMethod("42")).Do(delegate { });
25+
2626
_classPartialProxy = Substitute.For<ClassWithSingleMethod>();
2727
_classPartialProxy.IntMethod("42").Returns(42);
28-
_classPartialProxy.When(x => x.VoidMethod("42")).Do(delegate { });
29-
28+
_classPartialProxy.When(x => x.VoidMethod("42")).Do(delegate { });
29+
3030
_intDelegateProxy = Substitute.For<IntDelegate>();
3131
_intDelegateProxy.Invoke("42").Returns(42);
32-
32+
3333
_voidDelegateProxy = Substitute.For<VoidDelegate>();
34-
_voidDelegateProxy.When(x => x.Invoke("42")).Do(delegate { });
34+
_voidDelegateProxy.When(x => x.Invoke("42")).Do(delegate { });
3535
}
3636

3737
[Benchmark]
3838
public int DispatchInterfaceProxyCall_Int() => _interfaceProxy.IntMethod("42");
39-
39+
4040
[Benchmark]
4141
public int DispatchAbstractClassProxyCall_Int() => _abstractClassProxy.IntMethod("42");
4242

@@ -48,7 +48,7 @@ public DispatchConfiguredMatchingCallBenchmark()
4848

4949
[Benchmark]
5050
public void DispatchInterfaceProxyCall_Void() => _interfaceProxy.VoidMethod("42");
51-
51+
5252
[Benchmark]
5353
public void DispatchAbstractClassProxyCall_Void() => _abstractClassProxy.VoidMethod("42");
5454

tests/NSubstitute.Benchmarks/DispatchConfiguredNonMatchingCallBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace NSubstitute.Benchmarks
55
{
6-
[ClrJob, CoreJob]
6+
[SimpleJob]
77
[MemoryDiagnoser]
88
public class DispatchConfiguredNonMatchingCallBenchmark
99
{

0 commit comments

Comments
 (0)