public void Update_OpenLinearHashTable_UpdatedOneItem() { var hashTable = new OpenLinearHashTable <int, int>(); hashTable.Add(1, 1); hashTable.Add(1, 15); var val = hashTable.ToArray(); Assert.AreEqual((1, 1, 15), (val.Length, val[0].Key, val[0].Value)); }
public void Retrieve_OpenLinearHashTable_FoundProperValue() { var hashTable = new OpenLinearHashTable <int, int>(); hashTable.Add(1, 1); hashTable.Add(2, 15); hashTable.Add(3, 13); hashTable.Add(4, 10); var result = hashTable.Retrieve(3, out int found); Assert.AreEqual((result, found), (true, 13)); }