Skip to content

Commit

Permalink
use EnumPolyfill.IsDefined
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Dec 21, 2024
1 parent 378afeb commit 80b05c1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Adapter/MSTest.TestAdapter/MSTestSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -865,11 +865,7 @@ private static void SetParallelSettings(XmlReader reader, MSTestSettings setting
private static bool TryParseEnum<T>(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,
Expand Down

0 comments on commit 80b05c1

Please sign in to comment.