Skip to content

Commit

Permalink
Reverting an unintended breaking-change. (#826)
Browse files Browse the repository at this point in the history
Reverting an unintended breaking change in reflection.

Thank you, @azchohfi, for reporting it; this makes #824 unnecessary.
  • Loading branch information
Haplois committed May 13, 2021
1 parent 30aaca1 commit f68fd34
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Adapter/MSTest.CoreAdapter/Execution/TestMethodInfo.cs
Expand Up @@ -93,7 +93,9 @@ public Attribute[] GetAllAttributes(bool inherit)
}

public TAttributeType[] GetAttributes<TAttributeType>(bool inherit)
where TAttributeType : Attribute => ReflectHelper.GetAttributes<TAttributeType>(this.TestMethod, inherit);
where TAttributeType : Attribute
=> ReflectHelper.GetAttributes<TAttributeType>(this.TestMethod, inherit)
?? EmptyHolder<TAttributeType>.Array;

/// <summary>
/// Execute test method. Capture failures, handle async and return result.
Expand Down Expand Up @@ -784,5 +786,10 @@ void executeAsyncAction()
return timeoutResult;
}
}

private static class EmptyHolder<T>
{
internal static readonly T[] Array = new T[0];
}
}
}

0 comments on commit f68fd34

Please sign in to comment.