public void InsertTest() { Hashmap <string, int> hashmap = new Hashmap <string, int>(); hashmap.Insert("Hello!", 1); Assert.ThrowsException <ArgumentException>(() => { hashmap.Insert("Hello!", 2); }, "Failed to throw exception when duplicate keys were added."); }