File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using System . Diagnostics ;
2- using System . Runtime . InteropServices ;
1+ using System ;
2+ using System . Diagnostics ;
33using System . Threading . Tasks ;
44using FluentAssertions ;
55using Xunit ;
@@ -16,10 +16,8 @@ public async Task WaitForExitAsync_Test()
1616 {
1717 StartInfo = new ProcessStartInfo
1818 {
19- FileName = RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ? "cmd" : "sh" ,
20- Arguments = RuntimeInformation . IsOSPlatform ( OSPlatform . Windows )
21- ? "/c timeout 1"
22- : "-c 'sleep 1'" ,
19+ FileName = OperatingSystem . IsWindows ( ) ? "cmd" : "sh" ,
20+ Arguments = OperatingSystem . IsWindows ( ) ? "/c timeout 1" : "-c 'sleep 1'" ,
2321 CreateNoWindow = true ,
2422 UseShellExecute = false ,
2523 } ,
Original file line number Diff line number Diff line change 1- using System . Diagnostics ;
2- using System . Runtime . InteropServices ;
1+ using System ;
2+ using System . Diagnostics ;
33using FluentAssertions ;
44using Xunit ;
55
@@ -15,10 +15,8 @@ public void Kill_Test()
1515 {
1616 StartInfo = new ProcessStartInfo
1717 {
18- FileName = RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ? "cmd" : "sh" ,
19- Arguments = RuntimeInformation . IsOSPlatform ( OSPlatform . Windows )
20- ? "/c timeout 1"
21- : "-c 'sleep 1'" ,
18+ FileName = OperatingSystem . IsWindows ( ) ? "cmd" : "sh" ,
19+ Arguments = OperatingSystem . IsWindows ( ) ? "/c timeout 1" : "-c 'sleep 1'" ,
2220 CreateNoWindow = true ,
2321 UseShellExecute = false ,
2422 } ,
Original file line number Diff line number Diff line change 88using System ;
99using System . IO ;
1010using System . Linq ;
11- using System . Runtime . InteropServices ;
1211
1312internal static partial class PolyfillExtensions
1413{
@@ -19,7 +18,7 @@ internal static partial class PolyfillExtensions
1918 // https://learn.microsoft.com/dotnet/api/system.io.path.getrelativepath
2019 public static string GetRelativePath ( string relativeTo , string path )
2120 {
22- var pathStringComparison = RuntimeInformation . IsOSPlatform ( OSPlatform . Windows )
21+ var pathStringComparison = OperatingSystem . IsWindows ( )
2322 ? StringComparison . OrdinalIgnoreCase
2423 : StringComparison . Ordinal ;
2524
Original file line number Diff line number Diff line change 99using System . Diagnostics ;
1010using System . Linq ;
1111using System . Management ;
12- using System . Runtime . InteropServices ;
1312
1413internal static partial class PolyfillExtensions
1514{
@@ -54,7 +53,7 @@ static void KillProcessTree(int processId)
5453 }
5554
5655 // Currently, this polyfill only supports Windows
57- if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
56+ if ( ! OperatingSystem . IsWindows ( ) )
5857 {
5958 process . Kill ( ) ;
6059 return ;
You can’t perform that action at this time.
0 commit comments