public void TryGet_should_return_true_if_key_exists() { //Arrange var table = new Structures.HashTable <int, string>(); table.Add(1, "1"); //Act var result = table.TryGet(1, out var value); //Assert Assert.True(result); }
public void TryGet_should_return_value_if_key_exists() { //Arrange var table = new Structures.HashTable <int, string>(); table.Add(1, "2"); //Act var result = table.TryGet(1, out var outValue); //Assert Assert.AreEqual("2", outValue); }
public void TryGet_should_return_null_object_if_key_does_not_exist() { //Arrange var table = new Structures.HashTable <int, string>(); table.Add(1, "1"); //Act var result = table.TryGet(2, out var value); //Assert Assert.Null(value); }