public void Get_ForNotExistingKey_ThrowsException(ProbingType type) { //arrange var oaht = new OpenAddressingHashTable <string, int>(5, type); //arrange + act Action act = () => { oaht.Get("null"); }; //assert act.Should().Throw <System.Collections.Generic.KeyNotFoundException>(); }
public void Get_ForNull_ThrowsException(ProbingType type) { //arrange var oaht = new OpenAddressingHashTable <string, int>(5, type); //arrange + act Action act = () => { oaht.Get(null); }; //assert act.Should().Throw <ArgumentException>(); }
public void Get_ForExistingKey_ReturnsTheValue(ProbingType type) { //arrange const string key = "1"; const int value = 1; var oaht = new OpenAddressingHashTable <string, int>(5, type); oaht.Add(key, value); //act var result = oaht.Get(key); //assert result.Should().Be(value); }