private PropertyTree LoadTree(string path, string root) { string file = TestContext.GetFullPath(Path.Combine("Fixtures", path)); var node = PropertyTree.FromFile(file); var result = new PropertyTree(root); node.CopyContentsTo(result); return(result); }
public void get_simple_tree_from_file() { PropertyTree pt = PropertyTree.FromFile(GetContentPath("beta.xml")); Assert.Equal("beta", pt.Name); Assert.Equal(new [] { "c", "d", "a", "b" }, pt.Children.Select(c => c.Name).ToArray()); Assert.IsInstanceOf <Property>(pt.Children["c"]); Assert.IsInstanceOf <PropertyTree>(pt.Children["a"]); Assert.Equal(4, pt.Children.Count); Assert.Equal("3/30/2011 1:50 AM", pt.Children["a"]["e"].Value); }
protected PropertyTree LoadTree(string fileName) { return(PropertyTree.FromFile(GetContentPath(fileName))); }