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));
 }
Пример #2
0
        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));
        }
Пример #3
0
        public void NoMatchWith_myClassId_Property()
        {
            var pattern = new PoIdPattern();

            pattern.Match(ForClass <MyClass> .Property(x => x.myClassId)).Should().Be.False();
        }
Пример #4
0
        public void MatchWithMyClassIdProperty()
        {
            var pattern = new PoIdPattern();

            pattern.Match(ForClass <MyClass> .Property(x => x.MyClassId)).Should().Be.True();
        }