public void RemoveNotExists()
        {
            var trie = new TrieDictionary <char, bool> {
                { "ABC", false }
            };

            Assert.IsFalse(trie.Remove("A"));
            Assert.IsFalse(trie.Remove("X"));
        }
        public void RemoveNullKey()
        {
            // ReSharper disable once CollectionNeverQueried.Local
            var trie = new TrieDictionary <char, bool> {
                { "ABC", false }
            };

            // ReSharper disable once AssignNullToNotNullAttribute
            trie.Remove(null);
        }
        public void Remove()
        {
            const int initialCount = 5;

            var trie = new TrieDictionary <char, bool>
            {
                { "ABC", false }, { "AB", false }, { "ADE", false }, { "ABCDE", false }, { "X", false }
            };

            Assert.IsFalse(((IDictionary <IEnumerable <char>, bool>)trie).Remove(new KeyValuePair <IEnumerable <char>, bool>("XY", true)));
            Assert.IsFalse(((IDictionary <IEnumerable <char>, bool>)trie).Remove(new KeyValuePair <IEnumerable <char>, bool>("ABCD", true)));
            Assert.IsFalse(((IDictionary <IEnumerable <char>, bool>)trie).Remove(new KeyValuePair <IEnumerable <char>, bool>("ABCDE", true)));
            Assert.AreEqual(initialCount, trie.Count);
            Assert.IsTrue(((IDictionary <IEnumerable <char>, bool>)trie).Remove(new KeyValuePair <IEnumerable <char>, bool>("ABCDE", false)));
            Assert.AreEqual(initialCount - 1, trie.Count);
            Assert.IsTrue(trie.Remove("X"));
            Assert.AreEqual(initialCount - 2, trie.Count);
            Assert.IsTrue(trie.Remove("ABC"));
            Assert.AreEqual(initialCount - 3, trie.Count);
            Assert.IsFalse(trie.ContainsKey("ABC"));
            Assert.IsTrue(trie.ContainsKey("AB"));
            Assert.IsTrue(trie.ContainsKey("ADE"));
        }