示例#1
0
        public void is_protected()
        {
            Assert.Throws <ArgumentNullException>(() => ReflectionExtensions.IsProtected(null));

            Assert.True(typeof(TestObject).GetField("ProtectedField", BindingFlags.Instance | BindingFlags.NonPublic).IsProtected());
        }
示例#2
0
        public void is_property()
        {
            Assert.Throws <ArgumentNullException>(() => ReflectionExtensions.IsProperty(null));

            Assert.True(typeof(TestObject).AnyProperty("PublicProperty").To <MemberInfo>().IsProperty());
        }
示例#3
0
        public void is_event()
        {
            Assert.Throws <ArgumentNullException>(() => ReflectionExtensions.IsEvent(null));

            Assert.True(typeof(TestObject).AnyEvent("PublicEvent").To <MemberInfo>().IsEvent());
        }
示例#4
0
        public void is_method()
        {
            Assert.Throws <ArgumentNullException>(() => ReflectionExtensions.IsMethod(null));

            Assert.True(typeof(TestObject).AnyMethod("PublicMethod").To <MemberInfo>().IsMethod());
        }
示例#5
0
        public void is_constructor()
        {
            Assert.Throws <ArgumentNullException>(() => ReflectionExtensions.IsConstructor(null));

            Assert.True(typeof(TestObject).DefaultConstructor().To <MemberInfo>().IsConstructor());
        }