public void Initialize() { hashFunction1 = new HashFunction1(); hashFunction2 = new HashFunction2(); hashTable1 = new HashTable(5, hashFunction1); hashTable2 = new HashTable(5, hashFunction2); }
public void TestChangeHashFunction() { HashFunction hashfunction2 = new HashFunction2(); hash.InsertToHashTable(20); hash.InsertToHashTable(15); hash.ChangeHashfunction(hashfunction2); Assert.IsTrue(hash.Exist(15)); }
public void ChangeHashFunctionTest() { hashTable.AddValue("ab"); hashTable.AddValue("12345"); hashTable.AddValue("A1bc2"); IHashFunction func2 = new HashFunction2(); hashTable.ChangeHashFunction(func2); Assert.IsTrue(hashTable.Contains("ab")); Assert.IsTrue(hashTable.Contains("12345")); Assert.IsTrue(hashTable.Contains("A1bc2")); }