Jad*_*ias 7 .net c# attributes mstest visual-studio
如何使用C#测试MsTest的类属性和方法属性的存在?
public static bool HasAttribute<TAttribute>(this MemberInfo member)
where TAttribute : Attribute
{
var attributes =
member.GetCustomAttributes(typeof(TAttribute), true);
return attributes.Length > 0;
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5510 次 |
最近记录: |