Exemple #1
0
        public void WhenPropertyAtFirstLevelThenDoesNotMatch()
        {
            var pattern = new ComponentMemberDeepPathPattern();

            pattern.Match(new PropertyPath(null, ForClass <MyClass> .Property(x => x.Fake1))).Should().Be.False();
            pattern.Match(new PropertyPath(null, ForClass <MyClassWithComponent> .Property(x => x.Component1))).Should().Be.False();
        }
 public void WhenPreviousLevelIsCollectionThenDoesNotMatch()
 {
     var lelev0 = new PropertyPath(null, ForClass<MyClassWithComponent>.Property(x => x.Component1));
     var lelev1 = new PropertyPath(lelev0, ForClass<MyComponent>.Property(x => x.Collection));
     var lelev2 = new PropertyPath(lelev1, ForClass<MyClass>.Property(x => x.Fake1));
     var pattern = new ComponentMemberDeepPathPattern();
     pattern.Match(lelev2).Should().Be.False();
 }
Exemple #3
0
        public void WhenPreviousLevelIsCollectionThenDoesNotMatch()
        {
            var lelev0  = new PropertyPath(null, ForClass <MyClassWithComponent> .Property(x => x.Component1));
            var lelev1  = new PropertyPath(lelev0, ForClass <MyComponent> .Property(x => x.Collection));
            var lelev2  = new PropertyPath(lelev1, ForClass <MyClass> .Property(x => x.Fake1));
            var pattern = new ComponentMemberDeepPathPattern();

            pattern.Match(lelev2).Should().Be.False();
        }
 public void WhenLevel1ThenMatch()
 {
     var lelev0 = new PropertyPath(null, ForClass<MyClassWithComponent>.Property(x => x.Component1));
     var deppLevels = new[]
                      	{
                      		new PropertyPath(lelev0, ForClass<MyComponent>.Property(x => x.Prop1)),
                      		new PropertyPath(lelev0, ForClass<MyComponent>.Property(x => x.Prop2)),
                      		new PropertyPath(lelev0, ForClass<MyComponent>.Property(x => x.MyNested)),
                      		new PropertyPath(lelev0, ForClass<MyComponent>.Property(x => x.Collection)),
                      		new PropertyPath(lelev0, ForClass<MyComponent>.Property(x => x.ManyToOne)),
                      		new PropertyPath(lelev0, ForClass<MyComponent>.Property(x => x.OneToOne)),
                      		new PropertyPath(lelev0, ForClass<MyComponent>.Property(x => x.Any)),
                      	};
     var pattern = new ComponentMemberDeepPathPattern();
     deppLevels.All(pp => pp.Satisfy(x => pattern.Match(x)));
 }
Exemple #5
0
        public void WhenLevel1ThenMatch()
        {
            var lelev0     = new PropertyPath(null, ForClass <MyClassWithComponent> .Property(x => x.Component1));
            var deppLevels = new[]
            {
                new PropertyPath(lelev0, ForClass <MyComponent> .Property(x => x.Prop1)),
                new PropertyPath(lelev0, ForClass <MyComponent> .Property(x => x.Prop2)),
                new PropertyPath(lelev0, ForClass <MyComponent> .Property(x => x.MyNested)),
                new PropertyPath(lelev0, ForClass <MyComponent> .Property(x => x.Collection)),
                new PropertyPath(lelev0, ForClass <MyComponent> .Property(x => x.ManyToOne)),
                new PropertyPath(lelev0, ForClass <MyComponent> .Property(x => x.OneToOne)),
                new PropertyPath(lelev0, ForClass <MyComponent> .Property(x => x.Any)),
            };
            var pattern = new ComponentMemberDeepPathPattern();

            deppLevels.All(pp => pp.Satisfy(x => pattern.Match(x)));
        }
 public void WhenPropertyAtFirstLevelThenDoesNotMatch()
 {
     var pattern = new ComponentMemberDeepPathPattern();
     pattern.Match(new PropertyPath(null, ForClass<MyClass>.Property(x=>x.Fake1))).Should().Be.False();
     pattern.Match(new PropertyPath(null, ForClass<MyClassWithComponent>.Property(x=> x.Component1))).Should().Be.False();
 }