• Home
  • Raw
  • Download

Lines Matching full:dictionary

302             IDictionary dictionary = map;  in IDictionary_Add()
303 dictionary.Add("a", "b"); in IDictionary_Add()
305 Assert.Throws<ArgumentException>(() => dictionary.Add("a", "duplicate")); in IDictionary_Add()
306 Assert.Throws<InvalidCastException>(() => dictionary.Add(new object(), "key is bad")); in IDictionary_Add()
307 Assert.Throws<InvalidCastException>(() => dictionary.Add("value is bad", new object())); in IDictionary_Add()
314 IDictionary dictionary = map; in IDictionary_Contains()
316 Assert.IsFalse(dictionary.Contains("a")); in IDictionary_Contains()
317 Assert.IsFalse(dictionary.Contains(5)); in IDictionary_Contains()
319 Assert.IsFalse(dictionary.Contains(new DictionaryEntry("x", "y"))); in IDictionary_Contains()
320 Assert.IsTrue(dictionary.Contains("x")); in IDictionary_Contains()
327 IDictionary dictionary = map; in IDictionary_Remove()
328 dictionary.Remove("a"); in IDictionary_Remove()
329 Assert.AreEqual(1, dictionary.Count); in IDictionary_Remove()
330 dictionary.Remove(5); in IDictionary_Remove()
331 Assert.AreEqual(1, dictionary.Count); in IDictionary_Remove()
332 dictionary.Remove(new DictionaryEntry("x", "y")); in IDictionary_Remove()
333 Assert.AreEqual(1, dictionary.Count); in IDictionary_Remove()
334 dictionary.Remove("x"); in IDictionary_Remove()
335 Assert.AreEqual(0, dictionary.Count); in IDictionary_Remove()
336 Assert.Throws<ArgumentNullException>(() => dictionary.Remove(null)); in IDictionary_Remove()
343 IDictionary dictionary = map; in IDictionary_CopyTo()
345 dictionary.CopyTo(array, 1); in IDictionary_CopyTo()
348 dictionary.CopyTo(objectArray, 1); in IDictionary_CopyTo()
356 IDictionary dictionary = map; in IDictionary_IsFixedSize()
357 Assert.IsFalse(dictionary.IsFixedSize); in IDictionary_IsFixedSize()
363 IDictionary dictionary = new MapField<string, string> { { "x", "y" } }; in IDictionary_Keys()
364 CollectionAssert.AreEqual(new[] { "x" }, dictionary.Keys); in IDictionary_Keys()
370 IDictionary dictionary = new MapField<string, string> { { "x", "y" } }; in IDictionary_Values()
371 CollectionAssert.AreEqual(new[] { "y" }, dictionary.Values); in IDictionary_Values()
377 IDictionary dictionary = new MapField<string, string> { { "x", "y" } }; in IDictionary_IsSynchronized()
378 Assert.IsFalse(dictionary.IsSynchronized); in IDictionary_IsSynchronized()
384 IDictionary dictionary = new MapField<string, string> { { "x", "y" } }; in IDictionary_SyncRoot()
385 Assert.AreSame(dictionary, dictionary.SyncRoot); in IDictionary_SyncRoot()
391 IDictionary dictionary = new MapField<string, string> { { "x", "y" } }; in IDictionary_Indexer_Get()
392 Assert.AreEqual("y", dictionary["x"]); in IDictionary_Indexer_Get()
393 Assert.IsNull(dictionary["a"]); in IDictionary_Indexer_Get()
394 Assert.IsNull(dictionary[5]); in IDictionary_Indexer_Get()
395 Assert.Throws<ArgumentNullException>(() => dictionary[null].GetHashCode()); in IDictionary_Indexer_Get()
402 IDictionary dictionary = map; in IDictionary_Indexer_Set()
407 Assert.Throws<InvalidCastException>(() => dictionary[5] = "x"); in IDictionary_Indexer_Set()
408 Assert.Throws<InvalidCastException>(() => dictionary["x"] = 5); in IDictionary_Indexer_Set()
409 Assert.Throws<ArgumentNullException>(() => dictionary[null] = "z"); in IDictionary_Indexer_Set()
410 Assert.Throws<ArgumentNullException>(() => dictionary["x"] = null); in IDictionary_Indexer_Set()