Ignore casing in servicename tests on nano server (dotnet/corefx#40699)
authorViktor Hofer <viktor.hofer@microsoft.com>
Fri, 30 Aug 2019 13:31:38 +0000 (15:31 +0200)
committerStephen Toub <stoub@microsoft.com>
Fri, 30 Aug 2019 13:31:38 +0000 (09:31 -0400)
Commit migrated from https://github.com/dotnet/corefx/commit/0c650b2765f64186f2fe84e332d8a74108866db2

src/libraries/System.ServiceProcess.ServiceController/tests/SafeServiceControllerTests.cs

index 25c08a0..c3a8ff6 100644 (file)
@@ -163,7 +163,9 @@ namespace System.ServiceProcess.Tests
 
             var controller = new ServiceController();
             controller.ServiceName = KeyIsoSvcName;
-            Assert.Equal(keyIsoDisplayName, controller.DisplayName);
+
+            // On Nano Server >=1809 the casing is sometimes changed during normalization: Expected: KEYISO, Actual: KeyIso
+            Assert.Equal(keyIsoDisplayName, controller.DisplayName, ignoreCase: PlatformDetection.IsWindowsNanoServer);
         }
 
         [Fact]