public static void NegTest4()
{
MemberInfo element = null;
Type attributeType = typeof(ObsoleteAttribute);
Type clsType = typeof(DerivedClass);
Assert.Throws<ArgumentNullException>(() => (ObsoleteAttribute)Attribute.GetCustomAttribute(element, attributeType, false));
attributeType = null;
element = typeof(TestClass).GetMethod("method1");
Assert.Throws<ArgumentNullException>(() => (ObsoleteAttribute)Attribute.GetCustomAttribute(element, attributeType, false));
attributeType = typeof(object);
Assert.Throws<ArgumentException>(() => Attribute.GetCustomAttribute(element, attributeType, false));
Assert.Throws<AmbiguousMatchException>(() => Attribute.GetCustomAttribute(typeof(Attribute).GetMethod("GetCustomAttribute"), typeof(Attribute), false));
}