System.Tests.GetCustomAttribute.NegTest7 C# (CSharp) Method

NegTest7() private method

private NegTest7 ( ) : void
return void
        public static void NegTest7()
        {
            ParameterInfo element = null;
            Type attributeType = typeof(ArgumentUsageAttribute);
            Type clsType = typeof(DerivedClass);
            MethodInfo minfo = clsType.GetMethod("TestMethod");
            ParameterInfo[] paramInfos = minfo.GetParameters();

            Assert.Throws<ArgumentNullException>(() => (ArgumentUsageAttribute)Attribute.GetCustomAttribute(element, attributeType));
            attributeType = null;
            Assert.Throws<ArgumentNullException>(() => (ArgumentUsageAttribute)Attribute.GetCustomAttribute(paramInfos[0], attributeType));
            attributeType = typeof(object);
            Assert.Throws<ArgumentException>(() => (ArgumentUsageAttribute)Attribute.GetCustomAttribute(paramInfos[0], attributeType));

        }
        [Fact]