Lines Matching refs:keys
332 // Surprising, but IDictionary.Contains is only about keys.
433 var keys = map.Keys;
434 CollectionAssert.AreEqual(new string[0], keys);
437 CollectionAssert.AreEqual(new[] { "foo", "x" }, keys);
451 // Just test keys - we know the implementation is the same for values
456 var keys = map.Keys;
457 Assert.IsTrue(keys.IsReadOnly);
458 Assert.Throws<NotSupportedException>(() => keys.Clear());
459 Assert.Throws<NotSupportedException>(() => keys.Remove("a"));
460 Assert.Throws<NotSupportedException>(() => keys.Add("a"));
463 // Just test keys - we know the implementation is the same for values
468 var keys = map.Keys;
470 Assert.Throws<ArgumentException>(() => keys.CopyTo(array, 3));
471 Assert.Throws<ArgumentOutOfRangeException>(() => keys.CopyTo(array, -1));
472 keys.CopyTo(array, 1);
476 // Just test keys - we know the implementation is the same for values
481 ICollection keys = map.Keys;
484 Assert.Throws<ArgumentException>(() => keys.CopyTo(array, 3));
485 Assert.Throws<ArgumentOutOfRangeException>(() => keys.CopyTo(array, -1));
486 keys.CopyTo(array, 1);
494 var keys = map.Keys;
495 Assert.IsTrue(keys.Contains("foo"));
496 Assert.IsFalse(keys.Contains("bar")); // It's a value!
497 Assert.IsFalse(keys.Contains("1"));
499 Assert.Throws<ArgumentNullException>(() => keys.Contains(null));
506 var keys = map.Keys.ToArray(); // Uses CopyTo internally
507 CollectionAssert.AreEquivalent(new[] { "foo", "x" }, keys);
571 // This wouldn't usually happen, as protos can't use doubles as map keys,