public void AddingAndDeletingElementByHash2Test() { IHashFunction hash = new Hash2(); HashTable hashTable = new HashTable(hash); hashTable.AddValue("ghj"); hashTable.AddValue("wer"); hashTable.DeleteValue("ghj"); Assert.IsFalse(hashTable.HashContains("ghj")); Assert.IsTrue(hashTable.HashContains("wer")); }
public void ChangeHashFunctionTest() { IHashFunction hash = new Hash2(); HashTable hashTable = new HashTable(hash); hashTable.AddValue("asd"); hashTable.AddValue("vbn"); IHashFunction newHash = new Hash1(); hashTable.ChangeHashFunction(newHash); hashTable.AddValue("abn"); hashTable.DeleteValue("vbn"); Assert.IsTrue(hashTable.HashContains("abn")); Assert.IsTrue(hashTable.HashContains("asd")); Assert.IsFalse(hashTable.HashContains("vbn")); }