System.Tests.AttributeGetCustomAttributes.NegTest C# (CSharp) Method

NegTest() private method

private NegTest ( ) : void
return void
        public static void NegTest()
        {
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((Assembly)null));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((Module)null));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((MemberInfo)null));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((ParameterInfo)null));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((Assembly)null, false));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((Module)null, false));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((MemberInfo)null, false));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((ParameterInfo)null, false));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((Assembly)null, typeof(TestAttribute)));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((Module)null, typeof(TestAttribute)));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((MemberInfo)null, typeof(TestAttribute)));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((ParameterInfo)null, typeof(TestAttribute)));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((Assembly)null, typeof(TestAttribute), false));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((Module)null, typeof(TestAttribute), false));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((MemberInfo)null, typeof(TestAttribute), false));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes((ParameterInfo)null, typeof(TestAttribute), false));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes(Assembly.GetExecutingAssembly(), null, false));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes(typeof(TestClass2).GetEvent("TestEvent2"), null, false));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes(typeof(TestClass2).GetMethod("TestMethod2"), null, false));
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttributes(typeof(TestClass2).GetMethod("TestMethod2").GetParameters()[0], null, false));
        }
    }
AttributeGetCustomAttributes