Ejemplo n.º 1
0
 public SimpleKeyValueGetter(Expression <Func <Component, TKey?> > getProperty, int componentId)
 {
     _propertyName = getProperty.GetPropertyAccess().Name;
     _componentId  = componentId;
     _nullable     = true;
     _matcher      = new PropertyMatcher().With(getProperty, componentId);
 }
Ejemplo n.º 2
0
        public void Matches()
        {
            var matcher = new PropertyMatcher().With(c => ((TestComponent)c).Foo, 1).With(c => ((TestComponent)c).Bar, 2);

            Assert.True(matcher.Matches(2, nameof(TestComponent.Bar)));
            Assert.False(matcher.Matches(1, nameof(TestComponent.Bar)));
        }