Ejemplo n.º 1
0
        public void Add_ThrowsException_WhenKeyIsNull()
        {
            _dictionary = new SingleDictionary <string, string>();
            Action Do = () => _dictionary.Add(null, "value2");

            Do.Should().Throw <ArgumentNullException>();
        }
Ejemplo n.º 2
0
 public void Add_AddKeyValue_WhenDictionaryIsEmpty()
 {
     _dictionary = new SingleDictionary <string, string>();
     _dictionary.Add(new  KeyValuePair <string, string> ("key2", "value2"));
     _dictionary.AsEnumerable().Should().BeEquivalentTo(new KeyValuePair <string, string>[] {
         new KeyValuePair <string, string>("key2", "value2")
     });
 }
Ejemplo n.º 3
0
        public void Add_ThrowsNotImplementedException_WhenDictionaryIsNotEmpty()
        {
            Action Do = () => _dictionary.Add("key2", "value2");

            Do.Should().Throw <NotImplementedException>();
        }