public void PatternMatch() { var pattern = new PoIdPattern(); PropertyInfo pi = typeof(TestEntity).GetProperty("Id"); pi.Satisfy(p=> pattern.Match(p)); pi = typeof(TestEntity).GetProperty("id"); pi.Satisfy(p => pattern.Match(p)); pi = typeof(TestEntity).GetProperty("PoId"); pi.Satisfy(p => pattern.Match(p)); pi = typeof(TestEntity).GetProperty("POID"); pi.Satisfy(p => pattern.Match(p)); pi = typeof(TestEntity).GetProperty("OId"); pi.Satisfy(p => pattern.Match(p)); pi = typeof(TestEntity).GetProperty("Something"); pi.Satisfy(p => !pattern.Match(p)); }
public void PatternMatch() { var pattern = new PoIdPattern(); PropertyInfo pi = typeof(TestEntity).GetProperty("Id"); pi.Satisfy(p => pattern.Match(p)); pi = typeof(TestEntity).GetProperty("id"); pi.Satisfy(p => pattern.Match(p)); pi = typeof(TestEntity).GetProperty("PoId"); pi.Satisfy(p => pattern.Match(p)); pi = typeof(TestEntity).GetProperty("POID"); pi.Satisfy(p => pattern.Match(p)); pi = typeof(TestEntity).GetProperty("OId"); pi.Satisfy(p => pattern.Match(p)); pi = typeof(TestEntity).GetProperty("Something"); pi.Satisfy(p => !pattern.Match(p)); }
public void NoMatchWith_myClassId_Property() { var pattern = new PoIdPattern(); pattern.Match(ForClass <MyClass> .Property(x => x.myClassId)).Should().Be.False(); }
public void MatchWithMyClassIdProperty() { var pattern = new PoIdPattern(); pattern.Match(ForClass <MyClass> .Property(x => x.MyClassId)).Should().Be.True(); }