Repository: dotnet/runtime
File: src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs (C#)

Code before:
        // For use as needed on tests that time out when run on a Debug or Checked runtime.
        // Not relevant for timeouts on external activities, such as network timeouts.
        public static int SlowRuntimeTimeoutModifier
        {
            get
            {
                if (IsReleaseRuntime)
                    return 1;
                if (IsRiscV64Process)
                    return IsDebugRuntime ? 10 : 2;
                else
                    return IsDebugRuntime ? 5 : 1;
            }
        }

        public static bool IsCaseInsensitiveOS => IsWindows || IsOSX || IsMacCatalyst;
        public static bool IsCaseSensitiveOS => !IsCaseInsensitiveOS;

#if NET
        public static bool FileCreateCaseSensitive => IsCaseSensitiveOS && !RuntimeInformation.RuntimeIdentifier.StartsWith("iossimulator")
                                                                        && !RuntimeInformation.RuntimeIdentifier.StartsWith("tvossimulator");
#else
        public static bool FileCreateCaseSensitive => IsCaseSensitiveOS;
#endif

#if NET && NET11_0_OR_GREATER
        public static bool IsMultithreadingSupported => RuntimeFeature.IsMultithreadingSupported;
#else
        public static bool IsMultithreadingSupported => GetIsMultithreadingSupported(null);
        [UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "get_IsMultithreadingSupported")]
        static extern bool GetIsMultithreadingSupported([UnsafeAccessorType("System.Runtime.CompilerServices.RuntimeFeature, System.Private.CoreLib")] object? _);
#endif
        public static bool IsNotMultithreadingSupported => !IsMultithreadingSupported;
        public static bool IsWasmThreadingSupported => IsBrowser && IsMultithreadingSupported;
        public static bool IsNotWasmThreadingSupported => !IsWasmThreadingSupported;

        private static readonly Lazy<bool> s_isBinaryFormatterSupported = new Lazy<bool>(DetermineBinaryFormatterSupport);
        public static bool IsBinaryFormatterSupported => s_isBinaryFormatterSupported.Value;

        public static bool IsStartingProcessesSupported => !IsiOS && !IstvOS;

        public static bool IsLinqSpeedOptimized => !IsLinqSizeOptimized;
        public static bool IsLinqSizeOptimized => s_linqIsSizeOptimized.Value;
        private static readonly Lazy<bool> s_linqIsSizeOptimized = new Lazy<bool>(ComputeIsLinqSizeOptimized);
        private static bool ComputeIsLinqSizeOptimized()
        {
#if NET
            return (bool)typeof(Enumerable).GetMethod("get_IsSizeOptimized", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, Array.Empty<object>());
#else
            return false;
#endif

Review comment (suggestion):
```suggestion
#if NET11_0_OR_GREATER
```
NET11_0_OR_GREATER should be only ever defined when NET is defined

Code after:
        // For use as needed on tests that time out when run on a Debug or Checked runtime.
        // Not relevant for timeouts on external activities, such as network timeouts.
        public static int SlowRuntimeTimeoutModifier
        {
            get
            {
                if (IsReleaseRuntime)
                    return 1;
                if (IsRiscV64Process)
                    return IsDebugRuntime ? 10 : 2;
                else
                    return IsDebugRuntime ? 5 : 1;
            }
        }

        public static bool IsCaseInsensitiveOS => IsWindows || IsOSX || IsMacCatalyst;
        public static bool IsCaseSensitiveOS => !IsCaseInsensitiveOS;

#if NET
        public static bool FileCreateCaseSensitive => IsCaseSensitiveOS && !RuntimeInformation.RuntimeIdentifier.StartsWith("iossimulator")
                                                                        && !RuntimeInformation.RuntimeIdentifier.StartsWith("tvossimulator");
#else
        public static bool FileCreateCaseSensitive => IsCaseSensitiveOS;
#endif

#if NET11_0_OR_GREATER
        public static bool IsMultithreadingSupported => RuntimeFeature.IsMultithreadingSupported;
#else
        public static bool IsMultithreadingSupported { get; } = GetIsMultithreadingSupported();

        private static bool GetIsMultithreadingSupported()
        {
            if (!IsWasm)
                return true;

            try
            {
                Type runtimeFeatureType = typeof(System.Runtime.CompilerServices.RuntimeFeature);

                PropertyInfo isMultithreadingSupportedProperty = runtimeFeatureType.GetProperty("IsMultithreadingSupported", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
                if (isMultithreadingSupportedProperty != null)
                {
                    return (bool)isMultithreadingSupportedProperty.GetValue(null);
                }
            }
            catch
            {
                // if any of the reflection calls fail, assume multithreading is not supported.
            }
            return false;
        }