From 45df08c58da66c5f3e5a807ad4891d22ee6e82ac Mon Sep 17 00:00:00 2001 From: Chris Billson <66110962+chrisbillson@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:07:23 +0000 Subject: [PATCH] SystemTests: add net9 portability test (#326) * SystemTests: add net9 portability test * Apply suggestions from code review Co-authored-by: obligaron --------- Co-authored-by: obligaron --- CONTRIBUTING.md | 2 ++ .../Portability/Net90PortabilityTest.cs | 16 ++++++++++++++++ .../Data/TargetFramework.cs | 3 ++- .../FilesystemWriter/NetCoreSdkInfoProvider.cs | 2 ++ .../TargetFrameworkMonikerStringBuilder.cs | 1 + 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 Tests/Reqnroll.SystemTests/Portability/Net90PortabilityTest.cs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cef223bb6..0dc6a3f07 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,6 +17,8 @@ In order to run all system tests, you will need to have the following SDKs insta - .NET 4.8.1 SDK - .NET 6.0 SDK - .NET 7.0 SDK +- .NET 8.0 SDK +- .NET 9.0 SDK and of course **C# knowledge** if you are looking to contribute by coding. diff --git a/Tests/Reqnroll.SystemTests/Portability/Net90PortabilityTest.cs b/Tests/Reqnroll.SystemTests/Portability/Net90PortabilityTest.cs new file mode 100644 index 000000000..649aa2c77 --- /dev/null +++ b/Tests/Reqnroll.SystemTests/Portability/Net90PortabilityTest.cs @@ -0,0 +1,16 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Reqnroll.TestProjectGenerator.Data; + +namespace Reqnroll.SystemTests.Portability; + +[TestClass] +[TestCategory("DotNet")] +[TestCategory("Net90")] +public class Net90PortabilityTest : PortabilityTestBase +{ + protected override void TestInitialize() + { + base.TestInitialize(); + _testRunConfiguration.TargetFramework = TargetFramework.Net90; + } +} diff --git a/Tests/TestProjectGenerator/Reqnroll.TestProjectGenerator/Data/TargetFramework.cs b/Tests/TestProjectGenerator/Reqnroll.TestProjectGenerator/Data/TargetFramework.cs index b1e5ef73b..eaba5c824 100644 --- a/Tests/TestProjectGenerator/Reqnroll.TestProjectGenerator/Data/TargetFramework.cs +++ b/Tests/TestProjectGenerator/Reqnroll.TestProjectGenerator/Data/TargetFramework.cs @@ -20,6 +20,7 @@ public enum TargetFramework Net50, Net60, Net70, - Net80 + Net80, + Net90, } } diff --git a/Tests/TestProjectGenerator/Reqnroll.TestProjectGenerator/FilesystemWriter/NetCoreSdkInfoProvider.cs b/Tests/TestProjectGenerator/Reqnroll.TestProjectGenerator/FilesystemWriter/NetCoreSdkInfoProvider.cs index 1c6dcca27..714b24cbb 100644 --- a/Tests/TestProjectGenerator/Reqnroll.TestProjectGenerator/FilesystemWriter/NetCoreSdkInfoProvider.cs +++ b/Tests/TestProjectGenerator/Reqnroll.TestProjectGenerator/FilesystemWriter/NetCoreSdkInfoProvider.cs @@ -15,6 +15,7 @@ public class NetCoreSdkInfoProvider private static readonly NetCoreSdkInfo Net60 = new("6.0.100"); private static readonly NetCoreSdkInfo Net70 = new("7.0.100"); private static readonly NetCoreSdkInfo Net80 = new("8.0.100"); + private static readonly NetCoreSdkInfo Net90 = new("9.0.100"); private readonly IReadOnlyDictionary _sdkMappings = new Dictionary { @@ -28,6 +29,7 @@ public class NetCoreSdkInfoProvider [TargetFramework.Net60] = Net60, [TargetFramework.Net70] = Net70, [TargetFramework.Net80] = Net80, + [TargetFramework.Net90] = Net90, [TargetFramework.Netcoreapp31] = NetCore31, [TargetFramework.Netcoreapp30] = NetCore30, [TargetFramework.Netcoreapp22] = NetCore22, diff --git a/Tests/TestProjectGenerator/Reqnroll.TestProjectGenerator/TargetFrameworkMonikerStringBuilder.cs b/Tests/TestProjectGenerator/Reqnroll.TestProjectGenerator/TargetFrameworkMonikerStringBuilder.cs index d0a56b475..267fcc726 100644 --- a/Tests/TestProjectGenerator/Reqnroll.TestProjectGenerator/TargetFrameworkMonikerStringBuilder.cs +++ b/Tests/TestProjectGenerator/Reqnroll.TestProjectGenerator/TargetFrameworkMonikerStringBuilder.cs @@ -27,6 +27,7 @@ public class TargetFrameworkMonikerStringBuilder [TargetFramework.Net60] = "net6.0", [TargetFramework.Net70] = "net7.0", [TargetFramework.Net80] = "net8.0", + [TargetFramework.Net90] = "net9.0", }; public string BuildTargetFrameworkMoniker(TargetFramework targetFramework)