public void TestMatchObject() { var o = new Match() as object; Assert.IsTrue(o.IsPropertyMatch<Match, string>("Prop1", mm => mm.Prop1)); Assert.IsTrue(o.IsPropertyMatch<Match, int>("Prop2", mm => mm.Prop2)); Assert.IsTrue(o.IsPropertyMatch<Match, Match>("Prop3", mm => mm.Prop3)); Assert.IsTrue(o.IsPropertyMatch<Match, int?>("Prop4", mm => mm.Prop4)); Assert.IsFalse(o.IsPropertyMatch<Match, string>("Prop2", mm => mm.Prop1)); Assert.IsFalse(o.IsPropertyMatch<Match, int>("Something", mm => mm.Prop2)); Assert.IsFalse(o.IsPropertyMatch<Match, int>("", mm => mm.Prop2)); Assert.IsFalse(o.IsPropertyMatch<Match, int>(null, mm => mm.Prop2)); var oo = new Object(); Assert.IsFalse(oo.IsPropertyMatch<Match, string>("Prop1", mm => mm.Prop1)); Assert.IsFalse(oo.IsPropertyMatch<Match, int>("Prop2", mm => mm.Prop2)); Assert.IsFalse(oo.IsPropertyMatch<Match, Match>("Prop3", mm => mm.Prop3)); Assert.IsFalse(oo.IsPropertyMatch<Match, int?>("Prop4", mm => mm.Prop4)); Assert.IsFalse(oo.IsPropertyMatch<Match, string>("Prop2", mm => mm.Prop1)); Assert.IsFalse(oo.IsPropertyMatch<Match, int>("Something", mm => mm.Prop2)); Assert.IsFalse(oo.IsPropertyMatch<Match, int>("", mm => mm.Prop2)); Assert.IsFalse(oo.IsPropertyMatch<Match, int>(null, mm => mm.Prop2)); }