Example #1
0
 public void TestAddingNullValuesInTree()
 {
     TernaryTree<string> tree = new TernaryTree<string>();
     tree.Add("Key1", null);
     Assert.AreEqual(1, tree.Length);
     Assert.IsNull(tree["Key1"]);
     Assert.IsTrue(tree.Contains("Key1"));
 }
Example #2
0
        public void TestAddingNullValuesInTree()
        {
            TernaryTree <string> tree = new TernaryTree <string>();

            tree.Add("Key1", null);
            Assert.AreEqual(1, tree.Length);
            Assert.IsNull(tree["Key1"]);
            Assert.IsTrue(tree.Contains("Key1"));
        }
        public void Tree_Contains_All_Added_Keys()
        {
            TernaryTree <string> subject = TernaryTree <string> .Create(_keys);

            Assert.Multiple(() =>
            {
                foreach (string key in _keys)
                {
                    Assert.That(subject.Contains(key));
                }
            });
        }
        public void Contains_Returns_False_For_Invalid_Key()
        {
            TernaryTree <string> subject = TernaryTree <string> .Create(_keys);

            Assert.IsFalse(subject.Contains("invalid key"));
        }