public void Remove_should_throw_ArgumentException_if_key_does_not_exist() { //Arrange var table = new Structures.HashTable <int, string>(); table.Add(1, "1"); //Act & Assert Assert.Throws <ArgumentException>(() => table.Remove(2)); }
public void Remove_should_decrease_count_if_success() { //Arrange var table = new Structures.HashTable <int, string>(); table.Add(1, "1"); var expectedCount = 0; //Act table.Remove(1); var count = table.Count; //Assert Assert.AreEqual(expectedCount, count); }
public void Remove_should_remove_item_if_key_exists() { //Arrange var table = new Structures.HashTable <int, string>(); table.Add(1, "1"); var expectedCount = 0; //Act table.Remove(1); var count = table.Count; //Assert Assert.AreEqual(expectedCount, count); }