public bool HasAttribute(Type attributeType, Attribute expectedAttribute) { var attrs = Attribute.GetCustomAttributes(_methodInfo, attributeType); var any = attrs.Any( currentAttribute => Are.Alike(expectedAttribute, currentAttribute) ); return(any); }
public bool HasAttribute <T>(T expectedAttribute) where T : Attribute { var attrs = Attribute.GetCustomAttributes(_methodInfo, typeof(T)); var any = attrs.Any( currentAttribute => Are.Alike(expectedAttribute, currentAttribute) ); return(any); }
public static T IsLike <T>(T expected) { return(Arg.Is <T>(arg => Are.Alike(expected, arg))); }