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

NegTest2() private method

private NegTest2 ( ) : void
return void
        public static void NegTest2()
        {
            Assembly element = null;
            Type attributeType = typeof(DerivedAttribute1);
            Type clsType = typeof(DerivedClass);

            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttribute(element, attributeType, true));
            attributeType = null;
            element = typeof(AttributeGetCustomAttributes).Assembly; ;
            Assert.Throws<ArgumentNullException>(() => Attribute.GetCustomAttribute(element, attributeType, false));
            attributeType = typeof(myClass);
            Assert.Throws<ArgumentException>(() => Attribute.GetCustomAttribute(element, attributeType, true));
            attributeType = typeof(Attribute);
            Assert.Throws<AmbiguousMatchException>(() => Attribute.GetCustomAttribute(element, attributeType, true));

        }
        [Fact]