예제 #1
0
        public void DiggDuggs()
        {
            var o = new Foo();

            Tunnelier.Digg(new List <string> {
                "Parent", "Parent", "Name"
            }, o, null).IsNotNull();
        }
예제 #2
0
        public void GetValueFromAUnfullBranchReturnNull()
        {
            var o = new Foo()
            {
                Parent = new Foo()
                {
                }
            };

            Tunnelier.GetValue(new List <string>()
            {
                "Parent", "Parent", "Name"
            }, o).IsEqualTo(null);
        }
예제 #3
0
        public void GetValueReturns()
        {
            var o = new Foo {
                Parent = new Foo {
                    Parent = new Foo {
                        Name = "hey"
                    }
                }
            };
            var endpoint = Tunnelier.GetValue(new List <string> {
                "Parent", "Parent", "Name"
            }, o);

            endpoint.Property.GetValue(endpoint.Component).IsEqualTo("hey");
        }
예제 #4
0
        public static IEnumerable <PropertyWithComponent> Unflat(string flatPropertyName, object target, Func <Type, bool> f, StringComparison comparison)
        {
            var trails = TrailFinder.GetTrails(flatPropertyName, target.GetType().GetProps(), f, comparison);

            return(trails.Select(trail => Tunnelier.Digg(trail, target)));
        }
예제 #5
0
        public static IEnumerable <PropertyWithComponent> Flat(string flatPropertyName, object source, Func <Type, bool> f, StringComparison comparison)
        {
            var trails = TrailFinder.GetTrails(flatPropertyName, source.GetType().GetProps(), f, comparison);

            return(trails.Select(trail => Tunnelier.GetValue(trail, source)));
        }