public void is_protected() { Assert.Throws <ArgumentNullException>(() => ReflectionExtensions.IsProtected(null)); Assert.True(typeof(TestObject).GetField("ProtectedField", BindingFlags.Instance | BindingFlags.NonPublic).IsProtected()); }
public void is_property() { Assert.Throws <ArgumentNullException>(() => ReflectionExtensions.IsProperty(null)); Assert.True(typeof(TestObject).AnyProperty("PublicProperty").To <MemberInfo>().IsProperty()); }
public void is_event() { Assert.Throws <ArgumentNullException>(() => ReflectionExtensions.IsEvent(null)); Assert.True(typeof(TestObject).AnyEvent("PublicEvent").To <MemberInfo>().IsEvent()); }
public void is_method() { Assert.Throws <ArgumentNullException>(() => ReflectionExtensions.IsMethod(null)); Assert.True(typeof(TestObject).AnyMethod("PublicMethod").To <MemberInfo>().IsMethod()); }
public void is_constructor() { Assert.Throws <ArgumentNullException>(() => ReflectionExtensions.IsConstructor(null)); Assert.True(typeof(TestObject).DefaultConstructor().To <MemberInfo>().IsConstructor()); }