コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 protected PropertyTree LoadTree(string fileName)
 {
     return(PropertyTree.FromFile(GetContentPath(fileName)));
 }