Ejemplo n.º 1
0
        public void Contains()
        {
            var tree = new TTree <int>(2, 2);

            tree.Add(10);
            tree.Add(11);
            tree.Add(1);
            tree.Add(20);

            Assert.IsTrue(tree.Contains(1), "Should contain 1");
            Assert.IsTrue(tree.Contains(10), "Should contain 10");
            Assert.IsTrue(tree.Contains(11), "Should contain 11");
            Assert.IsTrue(tree.Contains(20), "Should contain 20");

            Assert.IsFalse(tree.Contains(5), "Should not contain 5");
            Assert.IsFalse(tree.Contains(3), "Should not contain 3");
            Assert.IsFalse(tree.Contains(7), "Should not contain 7");
        }