Skip to content

Commit

Permalink
Update tests to use .NET 6 (#2674)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed May 15, 2022
1 parent 52190a3 commit 197c6db
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
$nunitConsolePath = "$buildDir\Temp\NUnit.ConsoleRunner.$nunitConsoleVersion"

$builds = @(
@{Framework = "netstandard2.0"; TestsFunction = "NetCliTests"; TestFramework = "net5.0"; Enabled=$true},
@{Framework = "netstandard2.0"; TestsFunction = "NetCliTests"; TestFramework = "net6.0"; Enabled=$true},
@{Framework = "netstandard1.3"; TestsFunction = "NetCliTests"; TestFramework = "netcoreapp3.1"; Enabled=$true},
@{Framework = "netstandard1.0"; TestsFunction = "NetCliTests"; TestFramework = "netcoreapp2.1"; Enabled=$true},
@{Framework = "net45"; TestsFunction = "NUnitTests"; TestFramework = "net46"; NUnitFramework="net-4.0"; Enabled=$true},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net46;net5.0</TargetFrameworks>
<TargetFrameworks>net46;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<RootNamespace>Newtonsoft.Json.TestConsole</RootNamespace>
<AssemblyName>Newtonsoft.Json.TestConsole</AssemblyName>
Expand Down
6 changes: 3 additions & 3 deletions Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks Condition="'$(TestFrameworks)'==''">net46;net40;net35;net20;net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks Condition="'$(TestFrameworks)'==''">net46;net40;net35;net20;net6.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks Condition="'$(TestFrameworks)'!=''">$(TestFrameworks)</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<VersionPrefix>1.0</VersionPrefix>
Expand Down Expand Up @@ -109,7 +109,7 @@
<DefineConstants>NET20;$(AdditionalConstants)</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net5.0'">
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<PackageReference Include="BenchmarkDotNet" Version="$(BenchmarkDotNetPackageVersion)" />
<PackageReference Include="FSharp.Core" Version="$(FSharpCorePackageVersion)" />
<PackageReference Include="System.ObjectModel" Version="$(SystemObjectModelPackageVersion)" />
Expand All @@ -124,7 +124,7 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitRunnerVisualStudioPackageVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net5.0'">
<PropertyGroup Condition="'$(TargetFramework)'=='net6.0'">
<AssemblyTitle>Json.NET Tests .NET Standard 2.0</AssemblyTitle>
<ReferringTargetFrameworkForProjectReferences>.NETStandard,Version=v2.0</ReferringTargetFrameworkForProjectReferences>
<DefineConstants>NETSTANDARD2_0;DNXCORE50;PORTABLE;HAVE_BENCHMARKS;HAVE_REGEX_TIMEOUTS;$(AdditionalConstants)</DefineConstants>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ public void DefaultConstructor_Abstract()
}, new[]
{
"Cannot create an abstract class.",
"Cannot create an abstract class 'System.Type'." // mono
"Cannot create an abstract class 'System.Type'.", // mono
"Cannot dynamically create an instance of type 'System.Type'. Reason: Cannot create an abstract class." // net60
});
}

Expand Down
2 changes: 1 addition & 1 deletion Src/global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "6.0.100"
"version": "6.0.300"
}
}

0 comments on commit 197c6db

Please sign in to comment.