Beispiel #1
0
        private TestTree <KeyT> CreateTree <KeyT>(TestNode <KeyT> rootNode, int countNode) where KeyT : IComparable
        {
            var tree = new TestTree <KeyT>();
            var type = typeof(TestTree <KeyT>);
            var root = type.GetProperty("RootNode", BindingFlags.Instance | BindingFlags.NonPublic);

            root.SetValue(tree, rootNode);

            var count = type.GetProperty("Count", BindingFlags.Instance | BindingFlags.Public);

            count.SetValue(tree, countNode);

            return(tree);
        }
Beispiel #2
0
 public void SetUp()
 {
     this.IntTree = this.CreateTree <int>   (this.CreateIntTreeRootNode(), 15);
     this.StrTree = this.CreateTree <string>(this.CreateStrTreeRootNode(), 15);
 }