Lines Matching refs:Add
70 Assert.Throws<ArgumentNullException>(() => map.Add(0, nullValue));
72 map.Add(1, nonNullValue);
80 Assert.Throws<ArgumentNullException>(() => map.Add(null, new ForeignMessage()));
94 map.Add("a", "v1");
95 map.Add("b", "v2");
96 map.Add("c", "v3");
98 map.Add("d", "v4");
107 map1.Add("a", "v1");
108 map1.Add("b", "v2");
111 map2.Add("b", "v2");
112 map2.Add("a", "v1");
121 map1.Add("first key", "v1");
122 map1.Add("second key", "v2");
125 map2.Add("third key", "v1");
126 map2.Add("fourth key", "v2");
146 map1.Add("a", "first value");
147 map1.Add("b", "second value");
150 map2.Add("a", "third value");
151 map2.Add("b", "fourth value");
186 map.Add("foo", "bar");
187 Assert.Throws<ArgumentException>(() => map.Add("foo", "baz"));
195 collection.Add(NewKeyValuePair("x", "y"));
197 Assert.Throws<ArgumentException>(() => collection.Add(NewKeyValuePair("x", "z")));
214 map.Add("foo", "bar");
227 map.Add("foo", "bar");
243 map.Add("foo", "bar");
257 map.Add("x", "y");
275 map["x"] = "z"; // This won't throw, unlike Add.
316 dictionary.Add("a", "b");
318 Assert.Throws<ArgumentException>(() => dictionary.Add("a", "duplicate"));
319 Assert.Throws<InvalidCastException>(() => dictionary.Add(new object(), "key is bad"));
320 Assert.Throws<InvalidCastException>(() => dictionary.Add("value is bad", new object()));
459 Assert.Throws<NotSupportedException>(() => keys.Add("a"));