2007-11-05 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Mon, 5 Nov 2007 23:53:05 +0000 (23:53 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Mon, 5 Nov 2007 23:53:05 +0000 (23:53 -0000)
* DictionaryTest.cs: Test case for #322783 based on Francisco Moraes
sample code.

svn path=/trunk/mcs/; revision=88941

mcs/class/corlib/Test/System.Collections.Generic/ChangeLog
mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs

index 5f757cc1bd4511f38d2bfb415867e7aad98aa82d..c3d79abb8be80b09697274871dd03008bc919a61 100644 (file)
@@ -1,3 +1,8 @@
+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. 
index 270f840b1bed11222cd6b8968c1eceb1d88254c1..8289c3a8351fbcd357b839036989aee09275c5e4 100644 (file)
@@ -1,5 +1,5 @@
 //
-// MonoTests.System.Collections.Generic.Test.DictionaryTest
+// MonoTests.System.Collections.Generic.DictionaryTest
 //
 // Authors:
 //     Sureshkumar T (tsureshkumar@novell.com)
@@ -704,7 +704,22 @@ namespace MonoTests.System.Collections.Generic {
                        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");
+               }
        }
 }