Пример #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());
        }