Lines Matching refs:Add
71 Assert.Throws<ArgumentNullException>(() => map.Add(0, nullValue));
73 map.Add(1, nonNullValue);
81 Assert.Throws<ArgumentNullException>(() => map.Add(null, new ForeignMessage()));
95 map.Add("a", "v1");
96 map.Add("b", "v2");
97 map.Add("c", "v3");
99 map.Add("d", "v4");
108 map1.Add("a", "v1");
109 map1.Add("b", "v2");
112 map2.Add("b", "v2");
113 map2.Add("a", "v1");
122 map1.Add("first key", "v1");
123 map1.Add("second key", "v2");
126 map2.Add("third key", "v1");
127 map2.Add("fourth key", "v2");
147 map1.Add("a", "first value");
148 map1.Add("b", "second value");
151 map2.Add("a", "third value");
152 map2.Add("b", "fourth value");
187 map.Add("foo", "bar");
188 Assert.Throws<ArgumentException>(() => map.Add("foo", "baz"));
196 collection.Add(NewKeyValuePair("x", "y"));
198 Assert.Throws<ArgumentException>(() => collection.Add(NewKeyValuePair("x", "z")));
215 map.Add("foo", "bar");
228 map.Add("foo", "bar");
244 map.Add("foo", "bar");
258 map.Add("x", "y");
276 map["x"] = "z"; // This won't throw, unlike Add.
317 dictionary.Add("a", "b");
319 Assert.Throws<ArgumentException>(() => dictionary.Add("a", "duplicate"));
320 Assert.Throws<InvalidCastException>(() => dictionary.Add(new object(), "key is bad"));
321 Assert.Throws<InvalidCastException>(() => dictionary.Add("value is bad", new object()));
460 Assert.Throws<NotSupportedException>(() => keys.Add("a"));