public void Add() { Assert.Throws <ArgumentNullException>(() => _dictionary.Add(null, "a null key")); Assert.Throws <ArgumentException>(() => _dictionary.Add("two", "another second value")); Assert.Throws <NotSupportedException>((() => _readOnly.Add("bar0", "bar value"))); for (int i = 0; i < 20; i++) { string key = String.Format("bar{0}", i); _dictionary.Add(key, "bar value"); Assert.IsTrue(_dictionary.Contains(new StringStringPair(key, "bar value"))); } Assert.AreEqual(23, _dictionary.Count); }