From 80b05c18751c8c24bb7f4aec561a37428fb64e14 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 21 Dec 2024 18:04:21 +1100 Subject: [PATCH] use EnumPolyfill.IsDefined --- src/Adapter/MSTest.TestAdapter/MSTestSettings.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Adapter/MSTest.TestAdapter/MSTestSettings.cs b/src/Adapter/MSTest.TestAdapter/MSTestSettings.cs index 1be800f802..b773252ee3 100644 --- a/src/Adapter/MSTest.TestAdapter/MSTestSettings.cs +++ b/src/Adapter/MSTest.TestAdapter/MSTestSettings.cs @@ -865,11 +865,7 @@ private static void SetParallelSettings(XmlReader reader, MSTestSettings setting private static bool TryParseEnum(string value, out T result) where T : struct, Enum => Enum.TryParse(value, true, out result) -#if NET6_0_OR_GREATER - && Enum.IsDefined(result); -#else - && Enum.IsDefined(typeof(T), result); -#endif + && EnumPolyfill.IsDefined(result); private static void SetGlobalSettings( [StringSyntax(StringSyntaxAttribute.Xml, nameof(runsettingsXml))] string runsettingsXml,