예제 #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"));
 }
예제 #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"));
        }
예제 #3
0
        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));
                }
            });
        }
예제 #4
0
        public void Contains_Returns_False_For_Invalid_Key()
        {
            TernaryTree <string> subject = TernaryTree <string> .Create(_keys);

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