Add() public method

Add an element to this structure consisting of the given key and patch command.

This method will return without executing if the cmd parameter's length is 0.

public Add ( string key, string cmd ) : void
key string the key
cmd string the patch command
return void
Exemplo n.º 1
0
        public void TestMultiTrie2Backwards()
        {
            Trie t = new MultiTrie2(false);

            string[] keys = { "a", "ba", "bb", "c" };

            /*
             * short vals won't work, see line 155 for example
             * the IOOBE is caught (wierd), but shouldnt affect patch cmds?
             */
            string[] vals = { "1111", "2222", "2223", "4444" };

            for (int i = 0; i < keys.Length; i++)
            {
                t.Add(keys[i], vals[i]);
            }

            AssertTrieContents(t, keys, vals);
        }
Exemplo n.º 2
0
        public void TestMultiTrie2()
        {
            Trie t = new MultiTrie2(true);

            string[] keys = { "a", "ba", "bb", "c" };
            /*
             * short vals won't work, see line 155 for example
             * the IOOBE is caught (wierd), but shouldnt affect patch cmds?
             */
            string[] vals = { "1111", "2222", "2223", "4444" };

            for (int i = 0; i < keys.Length; i++)
            {
                t.Add(keys[i], vals[i]);
            }

            AssertTrieContents(t, keys, vals);
        }