public void TestGetValue() { var foo = new FooClass { FooProperty = "moo" }; Assert.AreEqual("moo", foo.GetValue <string>("FooProperty")); }
public void TestGetElementType() { var foo1 = new FooClass { FooProperty = "moo" }; var foo2 = new FooClass { FooProperty = "moo" }; var foo3 = new FooClass { FooProperty = "moo" }; var coll = new[] { foo1, foo2, foo3 }.Select(f => f); var elemType = ReflectionExtensions.GetElementType(coll.GetType()); Assert.AreEqual(typeof(FooClass), elemType); }
public void TestHasMethod() { var foo = new FooClass(); Assert.IsTrue(foo.HasMethod("FooMethod")); }
public void TestHasProperty() { var foo = new FooClass(); Assert.IsTrue(foo.HasProperty("FooProperty")); }