public void GetValueFromAUnfullBranchReturnNull() { var o = new Foo() { Parent = new Foo() { } }; Tunnelier.GetValue(new List <string>() { "Parent", "Parent", "Name" }, o).IsEqualTo(null); }
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"); }
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))); }