public void Get(int key, object expected) { // arrange var mapa = new Algorithms.Hashtables.HashTable <string>(); mapa.Put(7865, "Isidro"); mapa.Put(7765, "Irmao do Isidro"); mapa.Put(123, "Josineidson"); mapa.Put(987, "Nilsonclecio"); mapa.Put(9832, "Deosdedite"); // act var node = mapa.Get(key); //assert Assert.AreEqual(node?.Key, expected); }
public void Update() { // arrange var oldValue = "Value 1"; var newValue = "Value 2"; var key = 7865; var mapa = new Algorithms.Hashtables.HashTable <string>(); mapa.Put(key, oldValue); // act mapa.Put(key, newValue); var node = mapa.Get(key); //assert Assert.AreEqual(node.Key, key); Assert.AreEqual(node.Value, newValue); }