Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverting an unintended breaking-change. #826

Merged
1 commit merged into from May 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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];
}
}
}