public override bool Matches(object actual)
{
this.actual = actual;
System.Reflection.ICustomAttributeProvider attrProvider =
actual as System.Reflection.ICustomAttributeProvider;
if (attrProvider == null)
throw new ArgumentException(string.Format("Actual value {0} does not implement ICustomAttributeProvider", actual), "actual");
Attribute[] attrs = (Attribute[])attrProvider.GetCustomAttributes(expectedType, true);
if (attrs.Length == 0)
throw new ArgumentException(string.Format("Attribute {0} was not found", expectedType), "actual");
attrFound = attrs[0];
return baseConstraint.Matches(attrFound);
}