public void Should_generate_a_hash_when_information_added() { DictionaryGeneric dico = new DictionaryGeneric(); int hash = dico.GetHashFrom("Hello"); Check.That(hash).IsEqualTo(5); }
public void Should_throw_an_exception_when_key_already_exist() { DictionaryGeneric dico = new DictionaryGeneric(); dico.Add("Hello", "titi"); Check.ThatCode(() => { dico.Add("Hello", "titi"); }).Throws <Exception>(); }
public void Should_return_an_null_when_key_not_existing_getted() { DictionaryGeneric dico = new DictionaryGeneric(); dico.Add("Hello", "titi"); var value = dico.Get("KEY"); Check.That(value).IsNull(); }
public void Should_add_and_return_an_element_when_you_called() { DictionaryGeneric dico = new DictionaryGeneric(); dico.Add("Hello", "titi"); string titiValue = dico.Get("Hello"); Check.That(titiValue).IsEqualTo("titi"); }
public void Should_return_size_when_selected() { DictionaryGeneric dico = new DictionaryGeneric(); dico.Add("Hello", "titi"); dico.Add("HILLA", "titi"); var size = dico.Size(); Check.That(size).IsEqualTo(2); }
public void Should_update_an_element_when_selected() { DictionaryGeneric dico = new DictionaryGeneric(); dico.Add("Hello", "titi"); dico.Update("Hello", "lala"); var value = dico.Get("Hello"); Check.That(value).IsEqualTo("lala"); }
public void Should_remove_an_element_when_selected() { DictionaryGeneric dico = new DictionaryGeneric(); dico.Add("Hello", "titi"); dico.Remove("Hello"); var value = dico.Get("Hello"); Check.That(value).IsNull(); }