+2007-11-05 Sebastien Pouliot <sebastien@ximian.com>
+
+ * DictionaryTest.cs: Test case for #322783 based on Francisco Moraes
+ sample code.
+
2006-04-16 Jonathan Chambers <joncham@gmail.com>
* ListTest.cs: Test Contains after Remove.
//
-// MonoTests.System.Collections.Generic.Test.DictionaryTest
+// MonoTests.System.Collections.Generic.DictionaryTest
//
// Authors:
// Sureshkumar T (tsureshkumar@novell.com)
for (int i = 1; i < 10; i++)
en.MoveNext();
}
-
+
+ [Test]
+ public void CopyToArray ()
+ {
+ Dictionary<string, string> test = new Dictionary<string, string> ();
+ test.Add ("monkey", "singe");
+ test.Add ("singe", "mono");
+ test.Add ("mono", "monkey");
+ Assert.AreEqual (3, test.Keys.Count, "Dictionary.Count");
+
+ ArrayList list = new ArrayList (test.Keys);
+ Assert.AreEqual (3, list.Count, "ArrayList.Count");
+ Assert.IsTrue (list.Contains ("monkey"), "monkey");
+ Assert.IsTrue (list.Contains ("singe"), "singe");
+ Assert.IsTrue (list.Contains ("mono"), "mono");
+ }
}
}