Skip to content

Commit

Permalink
Add support for Windows10Server to OSPlatformTranslator
Browse files Browse the repository at this point in the history
  • Loading branch information
manfred-brands committed Nov 30, 2023
1 parent 866d5a4 commit 112729c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
- name: 🔨 Build and Test
run: dotnet tool run dotnet-cake --target=Test --test-run-name=Windows --configuration=Release

- name: 🔨 Windows Specific Tests
run: dotnet test --no-build --configuration=Release src/NUnitFramework/windows-tests/windows-tests.csproj

- name: 📦 Package
run: dotnet tool run dotnet-cake --target=Package

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ private static IEnumerable<string> Translate(string osName, int majorVersion)
if (version >= majorVersion)
yield return "Windows" + version;
}

if (majorVersion <= 10)
yield return "WindowsServer10";
}
break;
case "OSX":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace NUnit.Framework.Tests.Attributes
public class OSPlatformTranslatorTests
{
[TestCase("Windows", ExpectedResult = "Win")]
[TestCase("Windows7.0", ExpectedResult = "Windows7,Windows8,Windows10,Windows11")]
[TestCase("Windows10.0", ExpectedResult = "Windows10,Windows11")]
[TestCase("Windows7.0", ExpectedResult = "Windows7,Windows8,Windows10,Windows11,WindowsServer10")]
[TestCase("Windows10.0", ExpectedResult = "Windows10,Windows11,WindowsServer10")]
[TestCase("Windows11.0", ExpectedResult = "Windows11")]
[TestCase("Linux", ExpectedResult = "Linux")]
[TestCase("OSX", ExpectedResult = "MacOsX")]
Expand Down Expand Up @@ -88,6 +88,7 @@ public void TranslateMixedOSPlatformAttributes()
PlatformAttribute platform = TranslateIntoSinglePlatform(supported1, unsupported, supported2);
Assert.That(platform.Include, Does.Contain("Windows7"), nameof(platform.Include));
Assert.That(platform.Include, Does.Contain("Windows10"), nameof(platform.Include));
Assert.That(platform.Include, Does.Contain("WindowsServer10"), nameof(platform.Include));
Assert.That(platform.Include, Does.Contain("Linux"), nameof(platform.Include));
Assert.That(platform.Exclude, Is.EqualTo("Android"), nameof(platform.Exclude));
}
Expand All @@ -102,6 +103,7 @@ public void TranslateMixedPlatformAndOSPlatformAttributes()
PlatformAttribute platform = TranslateIntoSinglePlatform(sourcePlatform, supported1, supported2);
Assert.That(platform.Include, Does.Contain("Win"), nameof(platform.Include));
Assert.That(platform.Include, Does.Contain("Windows10"), nameof(platform.Include));
Assert.That(platform.Include, Does.Contain("WindowsServer10"), nameof(platform.Include));
Assert.That(platform.Exclude, Is.Null, nameof(platform.Exclude));
}

Expand Down

0 comments on commit 112729c

Please sign in to comment.