diff --git a/src/Platform/Microsoft.Testing.Extensions.OpenTelemetry/TestingPlatformResourceDetector.cs b/src/Platform/Microsoft.Testing.Extensions.OpenTelemetry/TestingPlatformResourceDetector.cs index 98d59397351..fa93795e99d 100644 --- a/src/Platform/Microsoft.Testing.Extensions.OpenTelemetry/TestingPlatformResourceDetector.cs +++ b/src/Platform/Microsoft.Testing.Extensions.OpenTelemetry/TestingPlatformResourceDetector.cs @@ -81,11 +81,13 @@ private static int GetCurrentProcessId() #endif } - private static string? GetOsType() - => RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "windows" - : RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "darwin" - : RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? "linux" - : null; + private static string? GetOsType() => true switch + { + _ when RuntimeInformation.IsOSPlatform(OSPlatform.Windows) => "windows", + _ when RuntimeInformation.IsOSPlatform(OSPlatform.OSX) => "darwin", + _ when RuntimeInformation.IsOSPlatform(OSPlatform.Linux) => "linux", + _ => null, + }; /// /// Maps onto the values allowed by the OpenTelemetry host.arch enum, which