Beispiel #1
0
 public void SetUpContext()
 {
     PathTree = new PathTree();
     PathTree.Put(new[] { "foo", "bar" }, "foo/bar");
 }
Beispiel #2
0
 public void SetUpContext()
 {
     PathTree = new PathTree();
 }
Beispiel #3
0
 public void returns_null_for_completely_unknown_path()
 {
     PathTree.Get(new[] { "bar", "baz" }).ShouldBe(null);
 }
Beispiel #4
0
        public void SetUpContext()
        {
            var tree = new PathTree();
            tree.Put(new[] { "foo", "bar", "1" }, "item 1");
            tree.Put(new[] { "foo", "bar", "baz", "2" }, "item 2");
            tree.Put(new[] { "foo", "3" }, "item 3");
            tree.Put(new[] { "4" }, "item 4");

            var result = tree.Transform(BuildBranch, BuildLeaf);
            ResultHash = ((KeyValuePair<string, object>)result).Value as Hashtable;
        }
Beispiel #5
0
 public void returns_null_for_unknown_sub_path()
 {
     PathTree.Get(new[] { "foo", "bar", "baz" }).ShouldBe(null);
 }
Beispiel #6
0
            public void Can_retrieve_node()
            {
                var o = PathTree.Get(new[] { "foo", "bar" });

                o.ShouldEqual("foo/bar");
            }
Beispiel #7
0
 public void SetUpContext()
 {
     PathTree = new PathTree();
     PathTree.Put(new[] { "foo", "bar" }, "foo/bar");
 }
Beispiel #8
0
 public void SetUpContext()
 {
     PathTree = new PathTree();
 }
Beispiel #9
0
        public object Transform(string path, PathTree.IPathTreeNode tree)
        {
            if (!(tree is PathTree.PathTreeBranchNode))
                return _buildLeaf(path, tree.Item);

            var children = tree.Children.Select(n => Transform(n.Key, n.Value)).ToArray();
            return _buildBranch(path, children);
        }