Exemple #1
0
        public void IncludeNullTest()
        {
            MyHashTable <string, int> ht = new MyHashTable <string, int>(5);
            string key = "QWERTY";

            ht[key] = 22;
            bool expected = false;

            bool actual = ht.Include(null);

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void IncludeFalseTest()
        {
            MyHashTable <string, int> ht = new MyHashTable <string, int>(5);
            string key = "ABC";

            ht[key] = 22;
            bool expected = false;

            bool actual = ht.Include(key + "E");

            Assert.AreEqual(expected, actual);
        }
Exemple #3
0
        public void RemoveSmallTest()
        {
            MyHashTable <string, int> ht = new MyHashTable <string, int>(5);
            string key = "ABC";

            ht[key] = 22;
            bool expected = false;

            ht.Remove(key);
            bool actual = ht.Include(key);

            Assert.AreEqual(expected, actual);
        }
Exemple #4
0
        public void RemoveBigTest()
        {
            MyHashTable <string, int> ht = new MyHashTable <string, int>(2);
            bool expected = false;

            for (int i = 0; i < 20; i++)
            {
                ht[i.ToString()] = i;
            }

            ht.Remove("2");
            bool actual = ht.Include("2");

            Assert.AreEqual(expected, actual);
        }