public void Test_IsEmpty_Count_OnCreation() { var hash = new LinearProbingHash <Byte, Char>(); Assert.True(hash.IsEmpty); Assert.Equal(0, hash.Count); }
public void Test_Add_Get() { var hash = new LinearProbingHash <Byte, Char>(); hash.Add(1, 'A'); Assert.Equal('A', hash.Get(1)); }
public void Test_Delete() { var hash = new LinearProbingHash <Byte, Char>(); hash.Add(1, 'A'); hash.Delete(1); Assert.False(hash.Contains(1)); }
public void Test_Contains() { var hash = new LinearProbingHash <Byte, Char>(); hash.Add(1, 'A'); hash.Add(2, 'B'); Assert.True(hash.Contains(1)); Assert.True(hash.Contains(2)); }
private LinearProbingHash <Byte, Char> CreateFullLinearProbingHash() { LinearProbingHash <Byte, Char> hash = new LinearProbingHash <Byte, Char>(7); hash.Add(1, 'A'); hash.Add(2, 'B'); hash.Add(3, 'C'); hash.Add(4, 'D'); hash.Add(5, 'E'); hash.Add(6, 'F'); return(hash); }
public void Test_Get_KeyNotFoundException() { var hash = new LinearProbingHash <Byte, Char>(); Assert.Throws <KeyNotFoundException>(() => hash.Get(100)); }