Exemple #1
0
        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();
        }
Exemple #2
0
        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");
        }
Exemple #3
0
        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");
        }
Exemple #4
0
        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();
        }