public void WordsCanExist() { HashTable newTable = new HashTable(99); newTable.AddHash("dog", "cat"); Assert.True(newTable.HashExists("dog")); }
public void CollisionIsInevitible() { HashTable newTable = new HashTable(1000); string newKeyOne = "Taco"; string newValueOne = "Delicious"; string newKeyTwo = "Cato"; string newValueTwo = "Cute"; newTable.AddHash(newKeyOne, newValueOne); newTable.AddHash(newKeyTwo, newValueTwo); string result = newTable.GetFromTable(newKeyOne); string secondResult = newTable.GetFromTable(newKeyTwo); Assert.Equal("Delicious", result); Assert.Equal("Cute", secondResult); }
public void CanReturnNull() { HashTable newTable = new HashTable(100); string newKey = "dog"; string newValue = "wally"; newTable.AddHash(newKey, newValue); string result = newTable.GetFromTable("Ian"); Assert.Null(result); }