public void TestDeletionsWithFiveCharTrie()
        {
            SingleEditDistanceTrie trie = GetFiveCharTrie();
            HashSet <int>          peers;

            // test deletion at end
            peers = trie.GetSingleDeletionPeers("LISTSS");
            Assert.AreEqual(1, peers.Count, "LISTSS should have 1 single-deletion peer in the 5-char trie");
            Assert.IsTrue(peers.Contains(2), "LISTS should be a single-deletion peer of LISTSS in the 5-char tree");

            // test deletion at beginning
            peers = trie.GetSingleDeletionPeers("LIUSTY");
            Assert.AreEqual(2, peers.Count, "LIUSTY should have 2 single-deletion peers in the 5-char trie");
            Assert.IsTrue(peers.Contains(3), "LISTY should be a single-deletion peer of LIUSTY in the 5-char tree");
            Assert.IsTrue(peers.Contains(11), "LUSTY should be a single-deletion peer of LIUSTY in the 5-char tree");

            // test deletion in middle
            peers = trie.GetSingleDeletionPeers("FLISTS");
            Assert.AreEqual(2, peers.Count, "FLISTS should have 2 single-deletion peers in the 5-char trie");
            Assert.IsTrue(peers.Contains(1), "FISTS should be a single-deletion peer of FLISTS in the 5-char tree");
            Assert.IsTrue(peers.Contains(2), "LISTS should be a single-deletion peer of FLISTS in the 5-char tree");
        }
Ejemplo n.º 2
0
        public void TestGetSingleDeletionPeersCorrectLength()
        {
            SingleEditDistanceTrie trie = new SingleEditDistanceTrie(FOO.Length - 1);

            trie.GetSingleDeletionPeers(FOO);
        }
Ejemplo n.º 3
0
        public void TestGetSingleDeletionPeersWrongLength()
        {
            SingleEditDistanceTrie trie = new SingleEditDistanceTrie(FOO.Length);

            trie.GetSingleDeletionPeers(FOO);
        }
Ejemplo n.º 4
0
        public void TestGetSingleDeletionPeersNull()
        {
            SingleEditDistanceTrie trie = new SingleEditDistanceTrie(FOO.Length);

            trie.GetSingleDeletionPeers(null);
        }