2009-06-24 Robert Jordan <robertj@gmx.net>
authorRobert Jordan <robertj@gmx.net>
Wed, 24 Jun 2009 14:58:20 +0000 (14:58 -0000)
committerRobert Jordan <robertj@gmx.net>
Wed, 24 Jun 2009 14:58:20 +0000 (14:58 -0000)
* ArrayListTest.cs, CollectionBaseTest.cs, DictionaryEntryTest.cs,
HashtableTest.cs: Convert all tests to new-style nunit methods.

* QueueTest.cs: likewise. Convertion revealed 25 test that were
disabled after the NUnit 2.4 update.

* StackTest.cs: likewise. Convertion revealed 24 test that were
disabled after the NUnit 2.4 update.

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

mcs/class/corlib/Test/System.Collections/ArrayListTest.cs
mcs/class/corlib/Test/System.Collections/ChangeLog
mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs
mcs/class/corlib/Test/System.Collections/DictionaryEntryTest.cs
mcs/class/corlib/Test/System.Collections/HashtableTest.cs
mcs/class/corlib/Test/System.Collections/QueueTest.cs
mcs/class/corlib/Test/System.Collections/StackTest.cs

index 21b2d43f0b387a779ba62c01ac5a5d7e72544a72..c47b7d66f06424c4cb20af288ba5aae9c80e7bdb 100644 (file)
@@ -14,14 +14,14 @@ using NUnit.Framework;
 namespace MonoTests.System.Collections
 {
        [TestFixture]
-       public class ArrayListTest : Assertion
+       public class ArrayListTest
        {
                [Test]
                public void TestCtor ()
                {
                        {
                                ArrayList al1 = new ArrayList ();
-                               AssertNotNull ("no basic ArrayList", al1);
+                               Assert.IsNotNull (al1, "no basic ArrayList");
                        }
                        {
                                bool errorThrown = false;
@@ -30,24 +30,22 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentNullException) {
                                        errorThrown = true;
                                }
-                               Assert ("null icollection error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "null icollection error not thrown");
                        }
                        {
                                // what can I say?  I like chars.  [--DB]
                                char [] coll = { 'a', 'b', 'c', 'd' };
                                ArrayList al1 = new ArrayList (coll);
-                               AssertNotNull ("no icollection ArrayList", al1);
+                               Assert.IsNotNull (al1, "no icollection ArrayList");
                                for (int i = 0; i < coll.Length; i++) {
-                                       AssertEquals (i + " not ctor'ed properly.",
-                                                        coll [i], al1 [i]);
+                                       Assert.AreEqual (coll [i], al1 [i], i + " not ctor'ed properly.");
                                }
                        }
                        {
                                try {
                                        Char [,] c1 = new Char [2, 2];
                                        ArrayList al1 = new ArrayList (c1);
-                                       Fail ("Should fail with multi-dimensional array in constructor.");
+                                       Assert.Fail ("Should fail with multi-dimensional array in constructor.");
                                } catch (RankException) {
                                }
                        }
@@ -59,8 +57,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("negative capacity error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "negative capacity error not thrown");
                        }
                }
 
@@ -76,22 +73,18 @@ namespace MonoTests.System.Collections
 #endif
                        for (int i = 1; i < 100; i++) {
                                ArrayList al1 = new ArrayList (i);
-                               AssertEquals ("Bad capacity of " + i,
-                                                i, al1.Capacity);
+                               Assert.AreEqual (i, al1.Capacity, "Bad capacity of " + i);
                        }
                        {
                                ArrayList al1 = new ArrayList (0);
                                // LAMESPEC: 
-                               // AssertEquals("Bad capacity when set to 0",
-                               //           16, al1.Capacity);
+                               // Assert.AreEqual (//       16, al1.Capacity, "Bad capacity when set to 0");
                                al1.Add ("?");
-                               AssertEquals ("Bad capacity when set to 0",
-                                                default_capacity, al1.Capacity);
+                               Assert.AreEqual (default_capacity, al1.Capacity, "Bad capacity when set to 0");
                        }
                        {
                                ArrayList al1 = new ArrayList ();
-                               AssertEquals ("Bad default capacity",
-                                                unspecified_capacity, al1.Capacity);
+                               Assert.AreEqual (unspecified_capacity, al1.Capacity, "Bad default capacity");
                        }
                }
 
@@ -100,19 +93,16 @@ namespace MonoTests.System.Collections
                {
                        {
                                ArrayList al1 = new ArrayList ();
-                               AssertEquals ("Bad initial count",
-                                                0, al1.Count);
+                               Assert.AreEqual (0, al1.Count, "Bad initial count");
                                for (int i = 1; i <= 100; i++) {
                                        al1.Add (i);
-                                       AssertEquals ("Bad count " + i,
-                                                        i, al1.Count);
+                                       Assert.AreEqual (i, al1.Count, "Bad count " + i);
                                }
                        }
                        for (int i = 0; i < 100; i++) {
                                char [] coll = new Char [i];
                                ArrayList al1 = new ArrayList (coll);
-                               AssertEquals ("Bad count for " + i,
-                                                i, al1.Count);
+                               Assert.AreEqual (i, al1.Count, "Bad count for " + i);
                        }
                }
 
@@ -120,28 +110,27 @@ namespace MonoTests.System.Collections
                public void TestIsFixed ()
                {
                        ArrayList al1 = new ArrayList ();
-                       Assert ("should not be fixed by default", !al1.IsFixedSize);
+                       Assert.IsTrue (!al1.IsFixedSize, "should not be fixed by default");
                        ArrayList al2 = ArrayList.FixedSize (al1);
-                       Assert ("fixed-size wrapper not working", al2.IsFixedSize);
+                       Assert.IsTrue (al2.IsFixedSize, "fixed-size wrapper not working");
                }
 
                [Test]
                public void TestIsReadOnly ()
                {
                        ArrayList al1 = new ArrayList ();
-                       Assert ("should not be ReadOnly by default", !al1.IsReadOnly);
+                       Assert.IsTrue (!al1.IsReadOnly, "should not be ReadOnly by default");
                        ArrayList al2 = ArrayList.ReadOnly (al1);
-                       Assert ("read-only wrapper not working", al2.IsReadOnly);
+                       Assert.IsTrue (al2.IsReadOnly, "read-only wrapper not working");
                }
 
                [Test]
                public void TestIsSynchronized ()
                {
                        ArrayList al1 = new ArrayList ();
-                       Assert ("should not be synchronized by default",
-                                  !al1.IsSynchronized);
+                       Assert.IsTrue (!al1.IsSynchronized, "should not be synchronized by default");
                        ArrayList al2 = ArrayList.Synchronized (al1);
-                       Assert ("synchronized wrapper not working", al2.IsSynchronized);
+                       Assert.IsTrue (al2.IsSynchronized, "synchronized wrapper not working");
                }
 
                [Test]
@@ -155,8 +144,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("negative item error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "negative item error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -165,15 +153,13 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("past-end item error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "past-end item error not thrown");
                        }
                        for (int i = 0; i <= 100; i++) {
                                al1.Add (i);
                        }
                        for (int i = 0; i <= 100; i++) {
-                               AssertEquals ("item not fetched for " + i,
-                                                i, al1 [i]);
+                               Assert.AreEqual (i, al1 [i], "item not fetched for " + i);
                        }
                }
 
@@ -187,21 +173,20 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentNullException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 1: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 1: " + e.ToString ());
                                }
-                               Assert ("null adapter error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "null adapter error not thrown");
                        }
                        {
                                char [] list = { 'a', 'b', 'c', 'd' };
                                ArrayList al1 = ArrayList.Adapter (list);
-                               AssertNotNull ("Couldn't get an adapter", al1);
+                               Assert.IsNotNull (al1, "Couldn't get an adapter");
                                for (int i = 0; i < list.Length; i++) {
-                                       AssertEquals ("adapter not adapting", list [i], al1 [i]);
+                                       Assert.AreEqual (list [i], al1 [i], "adapter not adapting");
                                }
                                list [0] = 'z';
                                for (int i = 0; i < list.Length; i++) {
-                                       AssertEquals ("adapter not adapting", list [i], al1 [i]);
+                                       Assert.AreEqual (list [i], al1 [i], "adapter not adapting");
                                }
                        }
                        // Test Binary Search
@@ -219,43 +204,38 @@ namespace MonoTests.System.Collections
                                        // this is what the docs say it should throw
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 1: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 1: " + e.ToString ());
                                }
-                               Assert ("search-for-wrong-type error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "search-for-wrong-type error not thrown");
                        }
 
                        {
                                char [] arr = { 'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd' };
                                ArrayList al1 = ArrayList.Adapter (arr);
-                               Assert ("couldn't find elem #1",
-                                          al1.BinarySearch ('c') >= 3);
-                               Assert ("couldn't find elem #2",
-                                          al1.BinarySearch ('c') < 6);
+                               Assert.IsTrue (al1.BinarySearch ('c') >= 3, "couldn't find elem #1");
+                               Assert.IsTrue (al1.BinarySearch ('c') < 6, "couldn't find elem #2");
                        }
                        {
                                char [] arr = { 'a', 'b', 'b', 'd', 'd', 'd', 'e', 'e' };
                                ArrayList al1 = ArrayList.Adapter (arr);
-                               AssertEquals ("couldn't find next-higher elem",
-                                                -4, al1.BinarySearch ('c'));
+                               Assert.AreEqual (-4, al1.BinarySearch ('c'), "couldn't find next-higher elem");
                        }
                        {
                                char [] arr = { 'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd' };
                                ArrayList al1 = ArrayList.Adapter (arr);
-                               AssertEquals ("couldn't find end",
-                                                -9, al1.BinarySearch ('e'));
+                               Assert.AreEqual (-9, al1.BinarySearch ('e'), "couldn't find end");
                        }
                        // Sort
                        {
                                char [] starter = { 'd', 'b', 'f', 'e', 'a', 'c' };
                                ArrayList al1 = ArrayList.Adapter (starter);
                                al1.Sort ();
-                               AssertEquals ("Should be sorted", 'a', al1 [0]);
-                               AssertEquals ("Should be sorted", 'b', al1 [1]);
-                               AssertEquals ("Should be sorted", 'c', al1 [2]);
-                               AssertEquals ("Should be sorted", 'd', al1 [3]);
-                               AssertEquals ("Should be sorted", 'e', al1 [4]);
-                               AssertEquals ("Should be sorted", 'f', al1 [5]);
+                               Assert.AreEqual ('a', al1 [0], "Should be sorted");
+                               Assert.AreEqual ('b', al1 [1], "Should be sorted");
+                               Assert.AreEqual ('c', al1 [2], "Should be sorted");
+                               Assert.AreEqual ('d', al1 [3], "Should be sorted");
+                               Assert.AreEqual ('e', al1 [4], "Should be sorted");
+                               Assert.AreEqual ('f', al1 [5], "Should be sorted");
                        }
 
                        // TODO - test other adapter types?
@@ -273,10 +253,9 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 1: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 1: " + e.ToString ());
                                }
-                               Assert ("add to fixed size error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "add to fixed size error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -287,19 +266,16 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 2: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 2: " + e.ToString ());
                                }
-                               Assert ("add to read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "add to read only error not thrown");
                        }
                        {
                                ArrayList al1 = new ArrayList ();
                                for (int i = 1; i <= 100; i++) {
                                        al1.Add (i);
-                                       AssertEquals ("add failed " + i,
-                                                        i, al1.Count);
-                                       AssertEquals ("add failed " + i,
-                                                        i, al1 [i - 1]);
+                                       Assert.AreEqual (i, al1.Count, "add failed " + i);
+                                       Assert.AreEqual (i, al1 [i - 1], "add failed " + i);
 
                                }
                        }
@@ -308,7 +284,7 @@ namespace MonoTests.System.Collections
                                ArrayList al1 = new ArrayList (strArray);
                                al1.Add ("Hi!");
                                al1.Add ("Hi!");
-                               AssertEquals ("add failed", 2, al1.Count);
+                               Assert.AreEqual (2, al1.Count, "add failed");
                        }
                }
 
@@ -325,10 +301,9 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 1: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 1: " + e.ToString ());
                                }
-                               Assert ("add to fixed size error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "add to fixed size error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -340,10 +315,9 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 2: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 2: " + e.ToString ());
                                }
-                               Assert ("add to read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "add to read only error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -353,23 +327,19 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentNullException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 3: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 3: " + e.ToString ());
                                }
-                               Assert ("add to read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "add to read only error not thrown");
                        }
 
                        {
                                ArrayList a1 = new ArrayList ();
-                               AssertEquals ("ArrayList should start empty",
-                                                0, a1.Count);
+                               Assert.AreEqual (0, a1.Count, "ArrayList should start empty");
                                char [] coll = { 'a', 'b', 'c' };
                                a1.AddRange (coll);
-                               AssertEquals ("ArrayList has wrong elements",
-                                                3, a1.Count);
+                               Assert.AreEqual (3, a1.Count, "ArrayList has wrong elements");
                                a1.AddRange (coll);
-                               AssertEquals ("ArrayList has wrong elements",
-                                                6, a1.Count);
+                               Assert.AreEqual (6, a1.Count, "ArrayList has wrong elements");
                        }
 
                        {
@@ -379,8 +349,7 @@ namespace MonoTests.System.Collections
                                        list.Add (1);
                                }
 
-                               AssertEquals ("BinarySearch off-by-one bug",
-                                               49, list.BinarySearch (1));
+                               Assert.AreEqual (49, list.BinarySearch (1), "BinarySearch off-by-one bug");
                        }
                }
 
@@ -401,31 +370,26 @@ namespace MonoTests.System.Collections
                                        // this is what the docs say it should throw
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 1: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 1: " + e.ToString ());
                                }
-                               Assert ("search-for-wrong-type error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "search-for-wrong-type error not thrown");
                        }
 
                        {
                                char [] arr = { 'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd' };
                                ArrayList al1 = new ArrayList (arr);
-                               Assert ("couldn't find elem #1",
-                                          al1.BinarySearch ('c') >= 3);
-                               Assert ("couldn't find elem #2",
-                                          al1.BinarySearch ('c') < 6);
+                               Assert.IsTrue (al1.BinarySearch ('c') >= 3, "couldn't find elem #1");
+                               Assert.IsTrue (al1.BinarySearch ('c') < 6, "couldn't find elem #2");
                        }
                        {
                                char [] arr = { 'a', 'b', 'b', 'd', 'd', 'd', 'e', 'e' };
                                ArrayList al1 = new ArrayList (arr);
-                               AssertEquals ("couldn't find next-higher elem",
-                                                -4, al1.BinarySearch ('c'));
+                               Assert.AreEqual (-4, al1.BinarySearch ('c'), "couldn't find next-higher elem");
                        }
                        {
                                char [] arr = { 'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd' };
                                ArrayList al1 = new ArrayList (arr);
-                               AssertEquals ("couldn't find end",
-                                                -9, al1.BinarySearch ('e'));
+                               Assert.AreEqual (-9, al1.BinarySearch ('e'), "couldn't find end");
                        }
 
                }
@@ -453,7 +417,7 @@ namespace MonoTests.System.Collections
                {
                        ArrayList al = new ArrayList ();
                        al.Add (this);
-                       AssertEquals ("null", -1, al.BinarySearch (null));
+                       Assert.AreEqual (-1, al.BinarySearch (null), "null");
                }
 
                // TODO - BinarySearch with IComparer
@@ -470,8 +434,7 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("add to fixed size error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "add to fixed size error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -482,29 +445,23 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("add to read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "add to read only error not thrown");
                        }
                        {
                                ArrayList al1 = new ArrayList ();
                                al1.Add ('c');
-                               AssertEquals ("should have one element",
-                                                1, al1.Count);
+                               Assert.AreEqual (1, al1.Count, "should have one element");
                                al1.Clear ();
-                               AssertEquals ("should be empty",
-                                                0, al1.Count);
+                               Assert.AreEqual (0, al1.Count, "should be empty");
                        }
                        {
                                int [] i1 = { 1, 2, 3, 4 };
                                ArrayList al1 = new ArrayList (i1);
-                               AssertEquals ("should have elements",
-                                                i1.Length, al1.Count);
+                               Assert.AreEqual (i1.Length, al1.Count, "should have elements");
                                int capacity = al1.Capacity;
                                al1.Clear ();
-                               AssertEquals ("should be empty again",
-                                                0, al1.Count);
-                               AssertEquals ("capacity shouldn't have changed",
-                                                capacity, al1.Capacity);
+                               Assert.AreEqual (0, al1.Count, "should be empty again");
+                               Assert.AreEqual (capacity, al1.Capacity, "capacity shouldn't have changed");
                        }
                }
 
@@ -515,9 +472,9 @@ namespace MonoTests.System.Collections
                                char [] c1 = { 'a', 'b', 'c' };
                                ArrayList al1 = new ArrayList (c1);
                                ArrayList al2 = (ArrayList) al1.Clone ();
-                               AssertEquals ("ArrayList match", al1 [0], al2 [0]);
-                               AssertEquals ("ArrayList match", al1 [1], al2 [1]);
-                               AssertEquals ("ArrayList match", al1 [2], al2 [2]);
+                               Assert.AreEqual (al1 [0], al2 [0], "ArrayList match");
+                               Assert.AreEqual (al1 [1], al2 [1], "ArrayList match");
+                               Assert.AreEqual (al1 [2], al2 [2], "ArrayList match");
                        }
                        {
                                char [] d10 = { 'a', 'b' };
@@ -526,12 +483,12 @@ namespace MonoTests.System.Collections
                                char [] [] d1 = { d10, d11, d12 };
                                ArrayList al1 = new ArrayList (d1);
                                ArrayList al2 = (ArrayList) al1.Clone ();
-                               AssertEquals ("Array match", al1 [0], al2 [0]);
-                               AssertEquals ("Array match", al1 [1], al2 [1]);
-                               AssertEquals ("Array match", al1 [2], al2 [2]);
+                               Assert.AreEqual (al1 [0], al2 [0], "Array match");
+                               Assert.AreEqual (al1 [1], al2 [1], "Array match");
+                               Assert.AreEqual (al1 [2], al2 [2], "Array match");
 
                                ((char []) al1 [0]) [0] = 'z';
-                               AssertEquals ("shallow copy", al1 [0], al2 [0]);
+                               Assert.AreEqual (al1 [0], al2 [0], "shallow copy");
                        }
                }
 
@@ -540,9 +497,9 @@ namespace MonoTests.System.Collections
                {
                        char [] c1 = { 'a', 'b', 'c' };
                        ArrayList al1 = new ArrayList (c1);
-                       Assert ("never find a null", !al1.Contains (null));
-                       Assert ("can't find value", al1.Contains ('b'));
-                       Assert ("shouldn't find value", !al1.Contains ('?'));
+                       Assert.IsTrue (!al1.Contains (null), "never find a null");
+                       Assert.IsTrue (al1.Contains ('b'), "can't find value");
+                       Assert.IsTrue (!al1.Contains ('?'), "shouldn't find value");
                }
 
                [Test]
@@ -557,9 +514,9 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentNullException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 1: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 1: " + e.ToString ());
                                }
-                               Assert ("error not thrown 1", errorThrown);
+                               Assert.IsTrue (errorThrown, "error not thrown 1");
                        }
                        {
                                bool errorThrown = false;
@@ -571,9 +528,9 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 2: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 2: " + e.ToString ());
                                }
-                               Assert ("error not thrown 2", errorThrown);
+                               Assert.IsTrue (errorThrown, "error not thrown 2");
                        }
                        {
                                bool errorThrown = false;
@@ -592,9 +549,9 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 3: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 3: " + e.ToString ());
                                }
-                               Assert ("error not thrown 3", errorThrown);
+                               Assert.IsTrue (errorThrown, "error not thrown 3");
                        }
                        {
                                bool errorThrown = false;
@@ -606,9 +563,9 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 4: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 4: " + e.ToString ());
                                }
-                               Assert ("error not thrown 4", errorThrown);
+                               Assert.IsTrue (errorThrown, "error not thrown 4");
                        }
                        {
                                bool errorThrown = false;
@@ -620,9 +577,9 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 5: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 5: " + e.ToString ());
                                }
-                               Assert ("error not thrown 5", errorThrown);
+                               Assert.IsTrue (errorThrown, "error not thrown 5");
                        }
                        {
                                bool errorThrown = false;
@@ -634,9 +591,9 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 6: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 6: " + e.ToString ());
                                }
-                               Assert ("error not thrown 6", errorThrown);
+                               Assert.IsTrue (errorThrown, "error not thrown 6");
                        }
                        {
                                bool errorThrown = false;
@@ -648,9 +605,9 @@ namespace MonoTests.System.Collections
                                } catch (InvalidCastException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 7: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 7: " + e.ToString ());
                                }
-                               Assert ("error not thrown 7", errorThrown);
+                               Assert.IsTrue (errorThrown, "error not thrown 7");
                        }
 
                        Char [] orig = { 'a', 'b', 'c', 'd' };
@@ -658,16 +615,16 @@ namespace MonoTests.System.Collections
                        Char [] copy = new Char [10];
                        Array.Clear (copy, 0, copy.Length);
                        al.CopyTo (copy, 3);
-                       AssertEquals ("Wrong CopyTo 0", (char) 0, copy [0]);
-                       AssertEquals ("Wrong CopyTo 1", (char) 0, copy [1]);
-                       AssertEquals ("Wrong CopyTo 2", (char) 0, copy [2]);
-                       AssertEquals ("Wrong CopyTo 3", orig [0], copy [3]);
-                       AssertEquals ("Wrong CopyTo 4", orig [1], copy [4]);
-                       AssertEquals ("Wrong CopyTo 5", orig [2], copy [5]);
-                       AssertEquals ("Wrong CopyTo 6", orig [3], copy [6]);
-                       AssertEquals ("Wrong CopyTo 7", (char) 0, copy [7]);
-                       AssertEquals ("Wrong CopyTo 8", (char) 0, copy [8]);
-                       AssertEquals ("Wrong CopyTo 9", (char) 0, copy [9]);
+                       Assert.AreEqual ((char) 0, copy [0], "Wrong CopyTo 0");
+                       Assert.AreEqual ((char) 0, copy [1], "Wrong CopyTo 1");
+                       Assert.AreEqual ((char) 0, copy [2], "Wrong CopyTo 2");
+                       Assert.AreEqual (orig [0], copy [3], "Wrong CopyTo 3");
+                       Assert.AreEqual (orig [1], copy [4], "Wrong CopyTo 4");
+                       Assert.AreEqual (orig [2], copy [5], "Wrong CopyTo 5");
+                       Assert.AreEqual (orig [3], copy [6], "Wrong CopyTo 6");
+                       Assert.AreEqual ((char) 0, copy [7], "Wrong CopyTo 7");
+                       Assert.AreEqual ((char) 0, copy [8], "Wrong CopyTo 8");
+                       Assert.AreEqual ((char) 0, copy [9], "Wrong CopyTo 9");
                }
 
                [Test]
@@ -707,15 +664,13 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentNullException) {
                                        errorThrown = true;
                                }
-                               Assert ("null arg error not thrown", errorThrown);
+                               Assert.IsTrue (errorThrown, "null arg error not thrown");
                        }
                        {
                                ArrayList al1 = new ArrayList ();
-                               AssertEquals ("arrays start un-fixed.",
-                                                false, al1.IsFixedSize);
+                               Assert.AreEqual (false, al1.IsFixedSize, "arrays start un-fixed.");
                                ArrayList al2 = ArrayList.FixedSize (al1);
-                               AssertEquals ("should be fixed.",
-                                                true, al2.IsFixedSize);
+                               Assert.AreEqual (true, al2.IsFixedSize, "should be fixed.");
                        }
                }
 
@@ -729,7 +684,7 @@ namespace MonoTests.System.Collections
                        al1.Add ("something");
                        try {
                                en.MoveNext ();
-                               Fail ("Add() didn't invalidate the enumerator");
+                               Assert.Fail ("Add() didn't invalidate the enumerator");
                        } catch (InvalidOperationException) {
                                // do nothing...this is what we expect
                        }
@@ -739,7 +694,7 @@ namespace MonoTests.System.Collections
                        al1.AddRange (al1);
                        try {
                                en.MoveNext ();
-                               Fail ("AddRange() didn't invalidate the enumerator");
+                               Assert.Fail ("AddRange() didn't invalidate the enumerator");
                        } catch (InvalidOperationException) {
                                // do nothing...this is what we expect
                        }
@@ -749,7 +704,7 @@ namespace MonoTests.System.Collections
                        al1.Clear ();
                        try {
                                en.MoveNext ();
-                               Fail ("Clear() didn't invalidate the enumerator");
+                               Assert.Fail ("Clear() didn't invalidate the enumerator");
                        } catch (InvalidOperationException) {
                                // do nothing...this is what we expect
                        }
@@ -760,7 +715,7 @@ namespace MonoTests.System.Collections
                        al1.Insert (0, "new first");
                        try {
                                en.MoveNext ();
-                               Fail ("Insert() didn't invalidate the enumerator");
+                               Assert.Fail ("Insert() didn't invalidate the enumerator");
                        } catch (InvalidOperationException) {
                                // do nothing...this is what we expect
                        }
@@ -770,7 +725,7 @@ namespace MonoTests.System.Collections
                        al1.InsertRange (0, al1);
                        try {
                                en.MoveNext ();
-                               Fail ("InsertRange() didn't invalidate the enumerator");
+                               Assert.Fail ("InsertRange() didn't invalidate the enumerator");
                        } catch (InvalidOperationException) {
                                // do nothing...this is what we expect
                        }
@@ -780,7 +735,7 @@ namespace MonoTests.System.Collections
                        al1.Remove ("this");
                        try {
                                en.MoveNext ();
-                               Fail ("Remove() didn't invalidate the enumerator");
+                               Assert.Fail ("Remove() didn't invalidate the enumerator");
                        } catch (InvalidOperationException) {
                                // do nothing...this is what we expect
                        }
@@ -790,7 +745,7 @@ namespace MonoTests.System.Collections
                        al1.RemoveAt (2);
                        try {
                                en.MoveNext ();
-                               Fail ("RemoveAt() didn't invalidate the enumerator");
+                               Assert.Fail ("RemoveAt() didn't invalidate the enumerator");
                        } catch (InvalidOperationException) {
                                // do nothing...this is what we expect
                        }
@@ -800,7 +755,7 @@ namespace MonoTests.System.Collections
                        al1.RemoveRange (1, 1);
                        try {
                                en.MoveNext ();
-                               Fail ("RemoveRange() didn't invalidate the enumerator");
+                               Assert.Fail ("RemoveRange() didn't invalidate the enumerator");
                        } catch (InvalidOperationException) {
                                // do nothing...this is what we expect
                        }
@@ -810,7 +765,7 @@ namespace MonoTests.System.Collections
                        al1.Reverse ();
                        try {
                                en.MoveNext ();
-                               Fail ("Reverse() didn't invalidate the enumerator");
+                               Assert.Fail ("Reverse() didn't invalidate the enumerator");
                        } catch (InvalidOperationException) {
                                // do nothing...this is what we expect
                        }
@@ -820,7 +775,7 @@ namespace MonoTests.System.Collections
                        al1.Sort ();
                        try {
                                en.MoveNext ();
-                               Fail ("Sort() didn't invalidate the enumerator");
+                               Assert.Fail ("Sort() didn't invalidate the enumerator");
                        } catch (InvalidOperationException) {
                                // do nothing...this is what we expect
                        }
@@ -837,8 +792,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("negative index error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "negative index error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -848,8 +802,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("negative index error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "negative index error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -859,31 +812,28 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentException) {
                                        errorThrown = true;
                                }
-                               Assert ("out-of-range index error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "out-of-range index error not thrown");
                        }
                        {
                                String [] s1 = { "this", "is", "a", "test" };
                                ArrayList al1 = new ArrayList (s1);
                                IEnumerator en = al1.GetEnumerator ();
-                               AssertNotNull ("No enumerator", en);
+                               Assert.IsNotNull (en, "No enumerator");
 
                                for (int i = 0; i < s1.Length; i++) {
                                        en.MoveNext ();
-                                       AssertEquals ("Not enumerating",
-                                                        al1 [i], en.Current);
+                                       Assert.AreEqual (al1 [i], en.Current, "Not enumerating");
                                }
                        }
                        {
                                String [] s1 = { "this", "is", "a", "test" };
                                ArrayList al1 = new ArrayList (s1);
                                IEnumerator en = al1.GetEnumerator (1, 2);
-                               AssertNotNull ("No enumerator", en);
+                               Assert.IsNotNull (en, "No enumerator");
 
                                for (int i = 0; i < 2; i++) {
                                        en.MoveNext ();
-                                       AssertEquals ("Not enumerating",
-                                                        al1 [i + 1], en.Current);
+                                       Assert.AreEqual (al1 [i + 1], en.Current, "Not enumerating");
                                }
                        }
                }
@@ -917,8 +867,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("negative index error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "negative index error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -928,8 +877,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("negative index error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "negative index error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -939,17 +887,15 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentException) {
                                        errorThrown = true;
                                }
-                               Assert ("out-of-range index error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "out-of-range index error not thrown");
                        }
                        {
                                char [] chars = { 'a', 'b', 'c', 'd', 'e', 'f' };
                                ArrayList a = new ArrayList (chars);
                                ArrayList b = a.GetRange (1, 3);
-                               AssertEquals ("GetRange returned wrong size ArrayList", 3, b.Count);
+                               Assert.AreEqual (3, b.Count, "GetRange returned wrong size ArrayList");
                                for (int i = 0; i < b.Count; i++) {
-                                       AssertEquals ("range didn't work",
-                                                        chars [i + 1], b [i]);
+                                       Assert.AreEqual (chars [i + 1], b [i], "range didn't work");
                                }
 
                                a [2] = '?'; // should screw up ArrayList b.
@@ -959,8 +905,7 @@ namespace MonoTests.System.Collections
                                } catch (InvalidOperationException) {
                                        errorThrown = true;
                                }
-                               AssertEquals ("Munging 'a' should mess up 'b'",
-                                                true, errorThrown);
+                               Assert.AreEqual (true, errorThrown, "Munging 'a' should mess up 'b'");
                        }
                        {
                                char [] chars = { 'a', 'b', 'c', 'd', 'e', 'f' };
@@ -969,13 +914,11 @@ namespace MonoTests.System.Collections
                                object [] obj_chars = b.ToArray ();
                                for (int i = 0; i < 3; i++) {
                                        char c = (char) obj_chars [i];
-                                       AssertEquals ("range.ToArray didn't work",
-                                                        chars [i + 3], c);
+                                       Assert.AreEqual (chars [i + 3], c, "range.ToArray didn't work");
                                }
                                char [] new_chars = (char []) b.ToArray (typeof (char));
                                for (int i = 0; i < 3; i++) {
-                                       AssertEquals ("range.ToArray with type didn't work",
-                                                        chars [i + 3], new_chars [i]);
+                                       Assert.AreEqual (chars [i + 3], new_chars [i], "range.ToArray with type didn't work");
                                }
                        }
                }
@@ -1009,8 +952,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("negative indexof error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "negative indexof error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1020,8 +962,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("past-end indexof error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "past-end indexof error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1031,8 +972,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("negative indexof error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "negative indexof error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1042,8 +982,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("past-end indexof error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "past-end indexof error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1053,28 +992,20 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("past-end indexof error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "past-end indexof error not thrown");
                        }
                        {
                                char [] c = { 'a', 'b', 'c', 'd', 'e' };
                                ArrayList a = new ArrayList (c);
-                               AssertEquals ("never find null",
-                                                -1, a.IndexOf (null));
-                               AssertEquals ("never find null",
-                                                -1, a.IndexOf (null, 0));
-                               AssertEquals ("never find null",
-                                                -1, a.IndexOf (null, 0, 5));
-                               AssertEquals ("can't find elem",
-                                                2, a.IndexOf ('c'));
-                               AssertEquals ("can't find elem",
-                                                2, a.IndexOf ('c', 2));
-                               AssertEquals ("can't find elem",
-                                                2, a.IndexOf ('c', 2, 2));
-                               AssertEquals ("shouldn't find elem",
-                                                -1, a.IndexOf ('c', 3, 2));
-                               AssertEquals ("shouldn't find", -1, a.IndexOf ('?'));
-                               AssertEquals ("shouldn't find", -1, a.IndexOf (3));
+                               Assert.AreEqual (-1, a.IndexOf (null), "never find null");
+                               Assert.AreEqual (-1, a.IndexOf (null, 0), "never find null");
+                               Assert.AreEqual (-1, a.IndexOf (null, 0, 5), "never find null");
+                               Assert.AreEqual (2, a.IndexOf ('c'), "can't find elem");
+                               Assert.AreEqual (2, a.IndexOf ('c', 2), "can't find elem");
+                               Assert.AreEqual (2, a.IndexOf ('c', 2, 2), "can't find elem");
+                               Assert.AreEqual (-1, a.IndexOf ('c', 3, 2), "shouldn't find elem");
+                               Assert.AreEqual (-1, a.IndexOf ('?'), "shouldn't find");
+                               Assert.AreEqual (-1, a.IndexOf (3), "shouldn't find");
                        }
                }
 
@@ -1108,8 +1039,7 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("insert to fixed size error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "insert to fixed size error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1120,8 +1050,7 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("insert to read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "insert to read only error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1131,8 +1060,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("insert to read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "insert to read only error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1142,19 +1070,18 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("insert to read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "insert to read only error not thrown");
                        }
                        {
                                ArrayList al1 = new ArrayList ();
-                               AssertEquals ("arraylist starts empty", 0, al1.Count);
+                               Assert.AreEqual (0, al1.Count, "arraylist starts empty");
                                al1.Insert (0, 'a');
                                al1.Insert (1, 'b');
                                al1.Insert (0, 'c');
-                               AssertEquals ("arraylist needs stuff", 3, al1.Count);
-                               AssertEquals ("arraylist got stuff", 'c', al1 [0]);
-                               AssertEquals ("arraylist got stuff", 'a', al1 [1]);
-                               AssertEquals ("arraylist got stuff", 'b', al1 [2]);
+                               Assert.AreEqual (3, al1.Count, "arraylist needs stuff");
+                               Assert.AreEqual ('c', al1 [0], "arraylist got stuff");
+                               Assert.AreEqual ('a', al1 [1], "arraylist got stuff");
+                               Assert.AreEqual ('b', al1 [2], "arraylist got stuff");
                        }
                }
 
@@ -1171,8 +1098,7 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("insert to fixed size error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "insert to fixed size error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1184,8 +1110,7 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("insert to read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "insert to read only error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1196,8 +1121,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("negative index insert error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "negative index insert error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1208,8 +1132,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("out-of-range insert error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "out-of-range insert error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1219,19 +1142,18 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentNullException) {
                                        errorThrown = true;
                                }
-                               Assert ("null insert error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "null insert error not thrown");
                        }
                        {
                                char [] c = { 'a', 'b', 'c' };
                                ArrayList a = new ArrayList (c);
                                a.InsertRange (1, c);
-                               AssertEquals ("bad insert 1", 'a', a [0]);
-                               AssertEquals ("bad insert 2", 'a', a [1]);
-                               AssertEquals ("bad insert 3", 'b', a [2]);
-                               AssertEquals ("bad insert 4", 'c', a [3]);
-                               AssertEquals ("bad insert 5", 'b', a [4]);
-                               AssertEquals ("bad insert 6", 'c', a [5]);
+                               Assert.AreEqual ('a', a [0], "bad insert 1");
+                               Assert.AreEqual ('a', a [1], "bad insert 2");
+                               Assert.AreEqual ('b', a [2], "bad insert 3");
+                               Assert.AreEqual ('c', a [3], "bad insert 4");
+                               Assert.AreEqual ('b', a [4], "bad insert 5");
+                               Assert.AreEqual ('c', a [5], "bad insert 6");
                        }
                }
 
@@ -1246,8 +1168,7 @@ namespace MonoTests.System.Collections
                        //} catch (ArgumentOutOfRangeException) {
                        //errorThrown = true;
                        //}
-                       //Assert("first negative lastindexof error not thrown", 
-                       //errorThrown);
+                       //Assert.IsTrue (//errorThrown, "first negative lastindexof error not thrown");
                        //}
                        {
                                bool errorThrown = false;
@@ -1257,8 +1178,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("past-end lastindexof error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "past-end lastindexof error not thrown");
                        }
                        //{
                        //bool errorThrown = false;
@@ -1268,8 +1188,7 @@ namespace MonoTests.System.Collections
                        //} catch (ArgumentOutOfRangeException) {
                        //errorThrown = true;
                        //}
-                       //Assert("second negative lastindexof error not thrown", 
-                       //errorThrown);
+                       //Assert.IsTrue (//errorThrown, "second negative lastindexof error not thrown");
                        //}
                        //{
                        //bool errorThrown = false;
@@ -1279,8 +1198,7 @@ namespace MonoTests.System.Collections
                        //} catch (ArgumentOutOfRangeException) {
                        //errorThrown = true;
                        //}
-                       //Assert("past-end lastindexof error not thrown", 
-                       //errorThrown);
+                       //Assert.IsTrue (//errorThrown, "past-end lastindexof error not thrown");
                        //}
                        //{
                        //bool errorThrown = false;
@@ -1290,39 +1208,31 @@ namespace MonoTests.System.Collections
                        //} catch (ArgumentOutOfRangeException) {
                        //errorThrown = true;
                        //}
-                       //Assert("past-end lastindexof error not thrown", 
-                       //errorThrown);
+                       //Assert.IsTrue (//errorThrown, "past-end lastindexof error not thrown");
                        //}
                        int iTest = 0;
                        try {
                                char [] c = { 'a', 'b', 'c', 'd', 'e' };
                                ArrayList a = new ArrayList (c);
-                               AssertEquals ("never find null",
-                                                -1, a.LastIndexOf (null));
+                               Assert.AreEqual (-1, a.LastIndexOf (null), "never find null");
                                iTest++;
-                               AssertEquals ("never find null",
-                                                -1, a.LastIndexOf (null, 4));
+                               Assert.AreEqual (-1, a.LastIndexOf (null, 4), "never find null");
                                iTest++;
-                               AssertEquals ("never find null",
-                                                -1, a.LastIndexOf (null, 4, 5));
+                               Assert.AreEqual (-1, a.LastIndexOf (null, 4, 5), "never find null");
                                iTest++;
-                               AssertEquals ("can't find elem",
-                                                2, a.LastIndexOf ('c'));
+                               Assert.AreEqual (2, a.LastIndexOf ('c'), "can't find elem");
                                iTest++;
-                               AssertEquals ("can't find elem",
-                                                2, a.LastIndexOf ('c', 4));
+                               Assert.AreEqual (2, a.LastIndexOf ('c', 4), "can't find elem");
                                iTest++;
-                               AssertEquals ("can't find elem",
-                                                2, a.LastIndexOf ('c', 3, 2));
+                               Assert.AreEqual (2, a.LastIndexOf ('c', 3, 2), "can't find elem");
                                iTest++;
-                               AssertEquals ("shouldn't find elem",
-                                                -1, a.LastIndexOf ('c', 4, 2));
+                               Assert.AreEqual (-1, a.LastIndexOf ('c', 4, 2), "shouldn't find elem");
                                iTest++;
-                               AssertEquals ("shouldn't find", -1, a.LastIndexOf ('?'));
+                               Assert.AreEqual (-1, a.LastIndexOf ('?'), "shouldn't find");
                                iTest++;
-                               AssertEquals ("shouldn't find", -1, a.LastIndexOf (1));
+                               Assert.AreEqual (-1, a.LastIndexOf (1), "shouldn't find");
                        } catch (Exception e) {
-                               Fail ("Unexpected exception caught when iTest=" + iTest + ". e=" + e);
+                               Assert.Fail ("Unexpected exception caught when iTest=" + iTest + ". e=" + e);
                        }
                }
 
@@ -1354,15 +1264,13 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentNullException) {
                                        errorThrown = true;
                                }
-                               Assert ("null arg error not thrown", errorThrown);
+                               Assert.IsTrue (errorThrown, "null arg error not thrown");
                        }
                        {
                                ArrayList al1 = new ArrayList ();
-                               AssertEquals ("arrays start writeable.",
-                                                false, al1.IsReadOnly);
+                               Assert.AreEqual (false, al1.IsReadOnly, "arrays start writeable.");
                                ArrayList al2 = ArrayList.ReadOnly (al1);
-                               AssertEquals ("should be readonly.",
-                                                true, al2.IsReadOnly);
+                               Assert.AreEqual (true, al2.IsReadOnly, "should be readonly.");
                        }
                }
 
@@ -1378,8 +1286,7 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("remove fixed size error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "remove fixed size error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1390,19 +1297,18 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("remove read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "remove read only error not thrown");
                        }
                        {
                                char [] c = { 'a', 'b', 'c' };
                                ArrayList a = new ArrayList (c);
                                a.Remove (1);
                                a.Remove ('?');
-                               AssertEquals ("should be unchanged", c.Length, a.Count);
+                               Assert.AreEqual (c.Length, a.Count, "should be unchanged");
                                a.Remove ('a');
-                               AssertEquals ("should be changed", 2, a.Count);
-                               AssertEquals ("should have shifted", 'b', a [0]);
-                               AssertEquals ("should have shifted", 'c', a [1]);
+                               Assert.AreEqual (2, a.Count, "should be changed");
+                               Assert.AreEqual ('b', a [0], "should have shifted");
+                               Assert.AreEqual ('c', a [1], "should have shifted");
                        }
                }
 
@@ -1418,8 +1324,7 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("remove from fixed size error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "remove from fixed size error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1430,8 +1335,7 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("remove from read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "remove from read only error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1441,8 +1345,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("remove at negative index error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "remove at negative index error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1452,16 +1355,15 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("remove at out-of-range index error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "remove at out-of-range index error not thrown");
                        }
                        {
                                char [] c = { 'a', 'b', 'c' };
                                ArrayList a = new ArrayList (c);
                                a.RemoveAt (0);
-                               AssertEquals ("should be changed", 2, a.Count);
-                               AssertEquals ("should have shifted", 'b', a [0]);
-                               AssertEquals ("should have shifted", 'c', a [1]);
+                               Assert.AreEqual (2, a.Count, "should be changed");
+                               Assert.AreEqual ('b', a [0], "should have shifted");
+                               Assert.AreEqual ('c', a [1], "should have shifted");
                        }
                }
 
@@ -1477,8 +1379,7 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("removerange from fixed size error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "removerange from fixed size error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1489,8 +1390,7 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("removerange from read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "removerange from read only error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1500,8 +1400,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("removerange at negative index error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "removerange at negative index error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1511,8 +1410,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("removerange at negative index error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "removerange at negative index error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1522,15 +1420,14 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentException) {
                                        errorThrown = true;
                                }
-                               Assert ("removerange at bad range error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "removerange at bad range error not thrown");
                        }
                        {
                                char [] c = { 'a', 'b', 'c' };
                                ArrayList a = new ArrayList (c);
                                a.RemoveRange (1, 2);
-                               AssertEquals ("should be changed", 1, a.Count);
-                               AssertEquals ("should have shifted", 'a', a [0]);
+                               Assert.AreEqual (1, a.Count, "should be changed");
+                               Assert.AreEqual ('a', a [0], "should have shifted");
                        }
                }
 
@@ -1562,24 +1459,18 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                }
-                               Assert ("repeat negative copies error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "repeat negative copies error not thrown");
                        }
                        {
                                ArrayList al1 = ArrayList.Repeat ("huh?", 0);
-                               AssertEquals ("should be nothing in array",
-                                                0, al1.Count);
+                               Assert.AreEqual (0, al1.Count, "should be nothing in array");
                        }
                        {
                                ArrayList al1 = ArrayList.Repeat ("huh?", 3);
-                               AssertEquals ("should be something in array",
-                                                3, al1.Count);
-                               AssertEquals ("array elem doesn't check",
-                                                "huh?", al1 [0]);
-                               AssertEquals ("array elem doesn't check",
-                                                "huh?", al1 [1]);
-                               AssertEquals ("array elem doesn't check",
-                                                "huh?", al1 [2]);
+                               Assert.AreEqual (3, al1.Count, "should be something in array");
+                               Assert.AreEqual ("huh?", al1 [0], "array elem doesn't check");
+                               Assert.AreEqual ("huh?", al1 [1], "array elem doesn't check");
+                               Assert.AreEqual ("huh?", al1 [2], "array elem doesn't check");
                        }
                }
 
@@ -1595,8 +1486,7 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("reverse on read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "reverse on read only error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1607,7 +1497,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentException) {
                                        errorThrown = true;
                                }
-                               Assert ("error not thrown", errorThrown);
+                               Assert.IsTrue (errorThrown, "error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1618,32 +1508,29 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentException) {
                                        errorThrown = true;
                                }
-                               Assert ("error not thrown", errorThrown);
+                               Assert.IsTrue (errorThrown, "error not thrown");
                        }
                        {
                                char [] c = { 'a', 'b', 'c', 'd', 'e' };
                                ArrayList al1 = new ArrayList (c);
                                al1.Reverse (2, 1);
                                for (int i = 0; i < al1.Count; i++) {
-                                       AssertEquals ("Should be no change yet",
-                                                        c [i], al1 [i]);
+                                       Assert.AreEqual (c [i], al1 [i], "Should be no change yet");
                                }
                                al1.Reverse ();
                                for (int i = 0; i < al1.Count; i++) {
-                                       AssertEquals ("Should be reversed",
-                                                        c [i], al1 [4 - i]);
+                                       Assert.AreEqual (c [i], al1 [4 - i], "Should be reversed");
                                }
                                al1.Reverse ();
                                for (int i = 0; i < al1.Count; i++) {
-                                       AssertEquals ("Should be back to normal",
-                                                        c [i], al1 [i]);
+                                       Assert.AreEqual (c [i], al1 [i], "Should be back to normal");
                                }
                                al1.Reverse (1, 3);
-                               AssertEquals ("Should be back to normal", c [0], al1 [0]);
-                               AssertEquals ("Should be back to normal", c [3], al1 [1]);
-                               AssertEquals ("Should be back to normal", c [2], al1 [2]);
-                               AssertEquals ("Should be back to normal", c [1], al1 [3]);
-                               AssertEquals ("Should be back to normal", c [4], al1 [4]);
+                               Assert.AreEqual (c [0], al1 [0], "Should be back to normal");
+                               Assert.AreEqual (c [3], al1 [1], "Should be back to normal");
+                               Assert.AreEqual (c [2], al1 [2], "Should be back to normal");
+                               Assert.AreEqual (c [1], al1 [3], "Should be back to normal");
+                               Assert.AreEqual (c [4], al1 [4], "Should be back to normal");
                        }
                }
 
@@ -1678,10 +1565,9 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 1: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 1: " + e.ToString ());
                                }
-                               Assert ("setrange on read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "setrange on read only error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1693,10 +1579,9 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 2: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 2: " + e.ToString ());
                                }
-                               Assert ("setrange with null error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "setrange with null error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1707,10 +1592,9 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 3: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 3: " + e.ToString ());
                                }
-                               Assert ("setrange with negative index error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "setrange with negative index error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1721,22 +1605,21 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentOutOfRangeException) {
                                        errorThrown = true;
                                } catch (Exception e) {
-                                       Fail ("Incorrect exception thrown at 4: " + e.ToString ());
+                                       Assert.Fail ("Incorrect exception thrown at 4: " + e.ToString ());
                                }
-                               Assert ("setrange with too much error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "setrange with too much error not thrown");
                        }
 
                        {
                                char [] c = { 'a', 'b', 'c' };
                                ArrayList al1 = ArrayList.Repeat ('?', 3);
-                               Assert ("no match yet", c [0] != (char) al1 [0]);
-                               Assert ("no match yet", c [1] != (char) al1 [1]);
-                               Assert ("no match yet", c [2] != (char) al1 [2]);
+                               Assert.IsTrue (c [0] != (char) al1 [0], "no match yet");
+                               Assert.IsTrue (c [1] != (char) al1 [1], "no match yet");
+                               Assert.IsTrue (c [2] != (char) al1 [2], "no match yet");
                                al1.SetRange (0, c);
-                               AssertEquals ("should match", c [0], al1 [0]);
-                               AssertEquals ("should match", c [1], al1 [1]);
-                               AssertEquals ("should match", c [2], al1 [2]);
+                               Assert.AreEqual (c [0], al1 [0], "should match");
+                               Assert.AreEqual (c [1], al1 [1], "should match");
+                               Assert.AreEqual (c [2], al1 [2], "should match");
                        }
                }
 
@@ -1757,7 +1640,7 @@ namespace MonoTests.System.Collections
                        al.InsertRange (2, al);
                        String [] s2 = { "this", "is", "this", "is", "a", "test", "a", "test" };
                        for (int i = 0; i < al.Count; i++) {
-                               AssertEquals ("at i=" + i, s2 [i], al [i]);
+                               Assert.AreEqual (s2 [i], al [i], "at i=" + i);
                        }
                }
 
@@ -1773,19 +1656,18 @@ namespace MonoTests.System.Collections
                                } catch (NotSupportedException) {
                                        errorThrown = true;
                                }
-                               Assert ("sort on read only error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "sort on read only error not thrown");
                        }
                        {
                                char [] starter = { 'd', 'b', 'f', 'e', 'a', 'c' };
                                ArrayList al1 = new ArrayList (starter);
                                al1.Sort ();
-                               AssertEquals ("Should be sorted", 'a', al1 [0]);
-                               AssertEquals ("Should be sorted", 'b', al1 [1]);
-                               AssertEquals ("Should be sorted", 'c', al1 [2]);
-                               AssertEquals ("Should be sorted", 'd', al1 [3]);
-                               AssertEquals ("Should be sorted", 'e', al1 [4]);
-                               AssertEquals ("Should be sorted", 'f', al1 [5]);
+                               Assert.AreEqual ('a', al1 [0], "Should be sorted");
+                               Assert.AreEqual ('b', al1 [1], "Should be sorted");
+                               Assert.AreEqual ('c', al1 [2], "Should be sorted");
+                               Assert.AreEqual ('d', al1 [3], "Should be sorted");
+                               Assert.AreEqual ('e', al1 [4], "Should be sorted");
+                               Assert.AreEqual ('f', al1 [5], "Should be sorted");
                        }
                        {
                                ArrayList al1 = new ArrayList ();
@@ -1797,12 +1679,12 @@ namespace MonoTests.System.Collections
                                al1.Add (null);
 
                                al1.Sort ();
-                               AssertEquals ("Should be null", null, al1 [0]);
-                               AssertEquals ("Should be 2. null", null, al1 [1]);
-                               AssertEquals ("Should be 3. null", null, al1 [2]);
-                               AssertEquals ("Should be 4. null", null, al1 [3]);
-                               AssertEquals ("Should be 32", 32, al1 [4]);
-                               AssertEquals ("Should be 33", 33, al1 [5]);
+                               Assert.AreEqual (null, al1 [0], "Should be null");
+                               Assert.AreEqual (null, al1 [1], "Should be 2. null");
+                               Assert.AreEqual (null, al1 [2], "Should be 3. null");
+                               Assert.AreEqual (null, al1 [3], "Should be 4. null");
+                               Assert.AreEqual (32, al1 [4], "Should be 32");
+                               Assert.AreEqual (33, al1 [5], "Should be 33");
                        }
                }
 
@@ -1839,8 +1721,7 @@ namespace MonoTests.System.Collections
                                } catch (ArgumentNullException) {
                                        errorThrown = true;
                                }
-                               Assert ("toarray with null error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "toarray with null error not thrown");
                        }
                        {
                                bool errorThrown = false;
@@ -1852,20 +1733,18 @@ namespace MonoTests.System.Collections
                                } catch (InvalidCastException) {
                                        errorThrown = true;
                                }
-                               Assert ("toarray with bad type error not thrown",
-                                          errorThrown);
+                               Assert.IsTrue (errorThrown, "toarray with bad type error not thrown");
                        }
                        {
                                char [] c1 = { 'a', 'b', 'c', 'd', 'e' };
                                ArrayList al1 = new ArrayList (c1);
                                object [] o2 = al1.ToArray ();
                                for (int i = 0; i < c1.Length; i++) {
-                                       AssertEquals ("should be copy", c1 [i], o2 [i]);
+                                       Assert.AreEqual (c1 [i], o2 [i], "should be copy");
                                }
                                Array c2 = al1.ToArray (c1 [0].GetType ());
                                for (int i = 0; i < c1.Length; i++) {
-                                       AssertEquals ("should be copy",
-                                                        c1 [i], c2.GetValue (i));
+                                       Assert.AreEqual (c1 [i], c2.GetValue (i), "should be copy");
                                }
                        }
                }
@@ -1894,11 +1773,11 @@ namespace MonoTests.System.Collections
                        }
                        al1.RemoveAt (0);
                        al1.TrimToSize ();
-                       AssertEquals ("no capacity match", size - 1, al1.Capacity);
+                       Assert.AreEqual (size - 1, al1.Capacity, "no capacity match");
 
                        al1.Clear ();
                        al1.TrimToSize ();
-                       AssertEquals ("no default capacity", capacity, al1.Capacity);
+                       Assert.AreEqual (capacity, al1.Capacity, "no default capacity");
                }
 
                class Comparer : IComparer
@@ -1927,7 +1806,7 @@ namespace MonoTests.System.Collections
                public void BinarySearch1_EmptyList ()
                {
                        ArrayList list = new ArrayList ();
-                       AssertEquals ("BinarySearch", -1, list.BinarySearch (0));
+                       Assert.AreEqual (-1, list.BinarySearch (0), "BinarySearch");
                }
 
                [Test]
@@ -1935,9 +1814,9 @@ namespace MonoTests.System.Collections
                {
                        Comparer comparer = new Comparer ();
                        ArrayList list = new ArrayList ();
-                       AssertEquals ("BinarySearch", -1, list.BinarySearch (0, comparer));
+                       Assert.AreEqual (-1, list.BinarySearch (0, comparer), "BinarySearch");
                        // bug 77030 - the comparer isn't called for an empty array/list
-                       Assert ("Called", !comparer.Called);
+                       Assert.IsTrue (!comparer.Called, "Called");
                }
 
                [Test]
@@ -1945,9 +1824,9 @@ namespace MonoTests.System.Collections
                {
                        Comparer comparer = new Comparer ();
                        ArrayList list = new ArrayList ();
-                       AssertEquals ("BinarySearch", -1, list.BinarySearch (0, 0, 0, comparer));
+                       Assert.AreEqual (-1, list.BinarySearch (0, 0, 0, comparer), "BinarySearch");
                        // bug 77030 - the comparer isn't called for an empty array/list
-                       Assert ("Called", !comparer.Called);
+                       Assert.IsTrue (!comparer.Called, "Called");
                }
 
                [Test]
@@ -1957,16 +1836,16 @@ namespace MonoTests.System.Collections
                public void AddRange_GetRange ()
                {
                        ArrayList source = ArrayList.Adapter (new object [] { "1", "2" });
-                       AssertEquals ("#1", 2, source.Count);
-                       AssertEquals ("#2", "1", source [0]);
-                       AssertEquals ("#3", "2", source [1]);
+                       Assert.AreEqual (2, source.Count, "#1");
+                       Assert.AreEqual ("1", source [0], "#2");
+                       Assert.AreEqual ("2", source [1], "#3");
                        ArrayList range = source.GetRange (1, 1);
-                       AssertEquals ("#4", 1, range.Count);
-                       AssertEquals ("#5", "2", range [0]);
+                       Assert.AreEqual (1, range.Count, "#4");
+                       Assert.AreEqual ("2", range [0], "#5");
                        ArrayList target = new ArrayList ();
                        target.AddRange (range);
-                       AssertEquals ("#6", 1, target.Count);
-                       AssertEquals ("#7", "2", target [0]);
+                       Assert.AreEqual (1, target.Count, "#6");
+                       Assert.AreEqual ("2", target [0], "#7");
                }
 
                [Test]
@@ -1978,9 +1857,9 @@ namespace MonoTests.System.Collections
                        ArrayList list = new ArrayList ();
                        list.Add (list);
                        IEnumerator enumerator = list.GetEnumerator ();
-                       Assert ("#1", enumerator.MoveNext ());
-                       Assert ("#2", object.ReferenceEquals (list, enumerator.Current));
-                       Assert ("#3", !enumerator.MoveNext ());
+                       Assert.IsTrue (enumerator.MoveNext (), "#1");
+                       Assert.IsTrue (object.ReferenceEquals (list, enumerator.Current), "#2");
+                       Assert.IsTrue (!enumerator.MoveNext (), "#3");
                }
        }
 }
index bde60812181640a24659d5183ceff2b81b1135ae..9e42b6aaf6115b3061af938b1adf2bfccaeea4a0 100644 (file)
@@ -1,3 +1,14 @@
+2009-06-24  Robert Jordan  <robertj@gmx.net>
+
+       * ArrayListTest.cs, CollectionBaseTest.cs, DictionaryEntryTest.cs,
+       HashtableTest.cs: Convert all tests to new-style nunit methods.
+
+       * QueueTest.cs: likewise. Convertion revealed 25 test that were
+       disabled after the NUnit 2.4 update.
+
+       * StackTest.cs: likewise. Convertion revealed 24 test that were
+       disabled after the NUnit 2.4 update.
+
 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
 
        * BitArrayTest.cs: Add a test for #421803.
index 5bace30b59e287a02cccfe565998ed9cc14ccaad..c2633a1001d8fe8f0bd498b0c18e9fcd28520667 100644 (file)
@@ -19,7 +19,7 @@ namespace MonoTests.System.Collections
 {
 
 [TestFixture]
-public class CollectionBaseTest : Assertion
+public class CollectionBaseTest
 {
        // We need a concrete class to test the abstract base class
        public class ConcreteCollection : CollectionBase 
@@ -162,7 +162,7 @@ public class CollectionBaseTest : Assertion
        public void Count() {
                ConcreteCollection myCollection;
                myCollection = new ConcreteCollection(4);
-               Assert(4 == myCollection.Count);
+               Assert.IsTrue (4 == myCollection.Count);
        }
 
        // Make sure GetEnumerator returns an object
@@ -170,7 +170,7 @@ public class CollectionBaseTest : Assertion
        public void GetEnumerator() {
                ConcreteCollection myCollection;
                myCollection = new ConcreteCollection(4);
-               Assert(null != myCollection.GetEnumerator());
+               Assert.IsTrue (null != myCollection.GetEnumerator());
        }
 
        // OnValid disallows nulls
@@ -189,15 +189,15 @@ public class CollectionBaseTest : Assertion
                numberOfItems = 3;
                // The constructor inserts
                myCollection = new ConcreteCollection(numberOfItems);
-               Assert(myCollection.onInsertFired);
-               Assert(myCollection.onInsertCompleteFired);
+               Assert.IsTrue (myCollection.onInsertFired);
+               Assert.IsTrue (myCollection.onInsertCompleteFired);
 
                // Using the IList interface, check inserts in the middle
                IList listObj = myCollection;
                listObj.Insert(1, 9);
-               Assert(myCollection.onInsertIndex == 1);
-               Assert(myCollection.onInsertCompleteIndex == 1);
-               Assert(myCollection.PeekAt(1) == 9);
+               Assert.IsTrue (myCollection.onInsertIndex == 1);
+               Assert.IsTrue (myCollection.onInsertCompleteIndex == 1);
+               Assert.IsTrue (myCollection.PeekAt(1) == 9);
        }
 
        // Test Clear and it's hooks
@@ -209,9 +209,9 @@ public class CollectionBaseTest : Assertion
                numberOfItems = 1;
                myCollection = new ConcreteCollection(numberOfItems);
                myCollection.Clear();
-               Assert(myCollection.Count == 0);
-               Assert(myCollection.onClearFired);
-               Assert(myCollection.onClearCompleteFired);
+               Assert.IsTrue (myCollection.Count == 0);
+               Assert.IsTrue (myCollection.onClearFired);
+               Assert.IsTrue (myCollection.onClearCompleteFired);
        }
 
        // Test RemoveAt, other removes and the hooks
@@ -228,16 +228,16 @@ public class CollectionBaseTest : Assertion
                myCollection.RemoveAt(1);
 
                // We should see the original third one in it's place
-               Assert(myCollection.PeekAt(1) == 2);
-               Assert(myCollection.onRemoveFired);
-               Assert(myCollection.onRemoveIndex == 1);
-               Assert(myCollection.onRemoveCompleteFired);
-               Assert(myCollection.onRemoveCompleteIndex == 1);
+               Assert.IsTrue (myCollection.PeekAt(1) == 2);
+               Assert.IsTrue (myCollection.onRemoveFired);
+               Assert.IsTrue (myCollection.onRemoveIndex == 1);
+               Assert.IsTrue (myCollection.onRemoveCompleteFired);
+               Assert.IsTrue (myCollection.onRemoveCompleteIndex == 1);
                IList listObj = myCollection;
                listObj.Remove(0);
                // Confirm parameters are being passed to the hooks
-               Assert(myCollection.onRemoveIndex == 0);
-               Assert(myCollection.onRemoveCompleteIndex == 0);
+               Assert.IsTrue (myCollection.onRemoveIndex == 0);
+               Assert.IsTrue (myCollection.onRemoveCompleteIndex == 0);
        }
 
        // Test the random access feature
@@ -250,13 +250,13 @@ public class CollectionBaseTest : Assertion
                myCollection = new ConcreteCollection(numberOfItems);
                IList listObj = myCollection;
                listObj[0] = 99;
-               Assert((int) listObj[0] == 99);
-               Assert(myCollection.onSetFired);
-               Assert(myCollection.onSetCompleteFired);
-               Assert(myCollection.onSetOldValue == 0);
-               Assert(myCollection.onSetCompleteOldValue == 0);
-               Assert(myCollection.onSetNewValue == 99);
-               Assert(myCollection.onSetCompleteNewValue == 99);
+               Assert.IsTrue ((int) listObj[0] == 99);
+               Assert.IsTrue (myCollection.onSetFired);
+               Assert.IsTrue (myCollection.onSetCompleteFired);
+               Assert.IsTrue (myCollection.onSetOldValue == 0);
+               Assert.IsTrue (myCollection.onSetCompleteOldValue == 0);
+               Assert.IsTrue (myCollection.onSetNewValue == 99);
+               Assert.IsTrue (myCollection.onSetCompleteNewValue == 99);
        }
 
        [Test]
@@ -269,7 +269,7 @@ public class CollectionBaseTest : Assertion
                        coll.BaseList.Add (0);
                } catch {
                }
-               AssertEquals (0, coll.Count);
+               Assert.AreEqual (0, coll.Count);
        }
 
        [Test]
@@ -284,7 +284,7 @@ public class CollectionBaseTest : Assertion
                } catch (ArgumentOutOfRangeException) {
                        throw;
                } finally {
-                       AssertEquals (false, coll.onValidateFired);
+                       Assert.AreEqual (false, coll.onValidateFired);
                }
        }
 
@@ -299,7 +299,7 @@ public class CollectionBaseTest : Assertion
                        coll.BaseList [0] = 11;
                } catch {
                } finally {
-                       AssertEquals (false, coll.onSetCompleteFired);
+                       Assert.AreEqual (false, coll.onSetCompleteFired);
                }
        }
 
@@ -320,11 +320,11 @@ public class CollectionBaseTest : Assertion
                        throwsException = false;
                } catch {
                } finally {
-                       Assert (throwsException);
-                       Assert (coll.onValidateFired);
-                       Assert (coll.onSetFired);
-                       Assert (coll.onSetCompleteFired);
-                       AssertEquals (88, coll.BaseList [0]);
+                       Assert.IsTrue (throwsException);
+                       Assert.IsTrue (coll.onValidateFired);
+                       Assert.IsTrue (coll.onSetFired);
+                       Assert.IsTrue (coll.onSetCompleteFired);
+                       Assert.AreEqual (88, coll.BaseList [0]);
                }
        }
 
index c90ff5de8dfdfc2c92b42f3d0db095b6d447cf7f..480e6c06cede1c277c38759010dcb3ae1d523514 100644 (file)
@@ -7,28 +7,28 @@ using NUnit.Framework;
 namespace MonoTests.System.Collections {
 
        [TestFixture]
-       public class DictionaryEntryTest : Assertion {
+       public class DictionaryEntryTest {
                [Test]
                public void Ctor () {
 
                        DictionaryEntry d = new DictionaryEntry (1, "something");
-                       AssertNotNull (d);
-                       AssertEquals ("#01", d.Key, 1);
-                       AssertEquals ("#02", d.Value, "something");
+                       Assert.IsNotNull (d);
+                       Assert.AreEqual (1, d.Key, "#01");
+                       Assert.AreEqual ("something", d.Value, "#02");
                }
 
                [Test]
                public void Key () {
                        DictionaryEntry d = new DictionaryEntry (1, "something");
                        d.Key = 77.77;
-                       AssertEquals ("#03", d.Key, 77.77);
+                       Assert.AreEqual (77.77, d.Key, "#03");
                }
 
                [Test]
                public void Value () {
                        DictionaryEntry d = new DictionaryEntry (1, "something");
                        d.Value = 'p';
-                       AssertEquals ("#04", d.Value, 'p');
+                       Assert.AreEqual ('p', d.Value, "#04");
                }
 
                [Test]
index a20b63876dfeb5f06369473dacc81a68111bd76c..109bcbf84d430235fabf08c9af196d8c6452080d 100644 (file)
@@ -23,12 +23,12 @@ namespace MonoTests.System.Collections {
 \r
 /// <summary>Hashtable test.</summary>\r
 [TestFixture]\r
-public class HashtableTest : Assertion {\r
+public class HashtableTest {\r
 \r
         [Test]\r
        public void TestCtor1() {\r
                Hashtable h = new Hashtable();\r
-               AssertNotNull("No hash table", h);\r
+               Assert.IsNotNull (h, "No hash table");\r
        }\r
 \r
         [Test]\r
@@ -40,8 +40,7 @@ public class HashtableTest : Assertion {
                        } catch (ArgumentNullException) {\r
                                errorThrown = true;\r
                        }\r
-                       Assert("null hashtable error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "null hashtable error not thrown");\r
                }\r
                {\r
                        string[] keys = {"this", "is", "a", "test"};\r
@@ -52,8 +51,7 @@ public class HashtableTest : Assertion {
                        }\r
                        Hashtable h2 = new Hashtable(h1);\r
                        for (int i = 0; i < keys.Length; i++) {\r
-                               AssertEquals("No match for key " + keys[i],\r
-                                            values[i], h2[keys[i]]);\r
+                               Assert.AreEqual (values[i], h2[keys[i]], "No match for key " + keys[i]);\r
                        }\r
                }\r
        }\r
@@ -79,29 +77,29 @@ public class HashtableTest : Assertion {
                // tests if negative capacity throws exception\r
                try {\r
                        Hashtable ht = new Hashtable (-10, 0.1f, null, null);\r
-                       Assert("must throw ArgumentOutOfRange exception, param: capacity", false);\r
+                       Assert.Fail ("must throw ArgumentOutOfRange exception, param: capacity");\r
                } catch (ArgumentOutOfRangeException e) {\r
-                       Assert("ParamName is not capacity", e.ParamName == "capacity");\r
+                       Assert.IsTrue (e.ParamName == "capacity", "ParamName is not capacity");\r
                }\r
 \r
                // tests if loadFactor out of range throws exception (low)\r
                try {\r
                        Hashtable ht = new Hashtable (100, 0.01f, null, null);\r
-                       Assert("must throw ArgumentOutOfRange exception, param: loadFactor, too low value", false);\r
+                       Assert.Fail ("must throw ArgumentOutOfRange exception, param: loadFactor, too low value");\r
                }       catch (ArgumentOutOfRangeException e) \r
                {\r
-                       Assert("ParamName is not loadFactor",e.ParamName == "loadFactor");\r
+                       Assert.IsTrue (e.ParamName == "loadFactor", "ParamName is not loadFactor");\r
                }\r
 \r
                // tests if loadFactor out of range throws exception (high)\r
                try \r
                {\r
                        Hashtable ht = new Hashtable (100, 2f, null, null);\r
-                       Assert("must throw ArgumentOutOfRange exception, param: loadFactor, too high value", false);\r
+                       Assert.Fail ("must throw ArgumentOutOfRange exception, param: loadFactor, too high value");\r
                }       \r
                catch (ArgumentOutOfRangeException e) \r
                {\r
-                       Assert("ParamName is not loadFactor", e.ParamName == "loadFactor");\r
+                       Assert.IsTrue (e.ParamName == "loadFactor", "ParamName is not loadFactor");\r
                }\r
 \r
        }\r
@@ -112,32 +110,28 @@ public class HashtableTest : Assertion {
         [Test] \r
        public void TestCount() {\r
                Hashtable h = new Hashtable();\r
-               AssertEquals("new table - count zero", 0, h.Count);\r
+               Assert.AreEqual (0, h.Count, "new table - count zero");\r
                int max = 100;\r
                for (int i = 1; i <= max; i++) {\r
                        h[i] = i;\r
-                       AssertEquals("Count wrong for " + i,\r
-                                    i, h.Count);\r
+                       Assert.AreEqual (i, h.Count, "Count wrong for " + i);\r
                }\r
                for (int i = 1; i <= max; i++) {\r
                        h[i] = i * 2;\r
-                       AssertEquals("Count shouldn't change at " + i,\r
-                                    max, h.Count);\r
+                       Assert.AreEqual (max, h.Count, "Count shouldn't change at " + i);\r
                }\r
        }\r
 \r
         [Test]        \r
        public void TestIsFixedSize() {\r
                Hashtable h = new Hashtable();\r
-               AssertEquals("hashtable not fixed by default",\r
-                            false, h.IsFixedSize);\r
+               Assert.AreEqual (false, h.IsFixedSize, "hashtable not fixed by default");\r
                // TODO - any way to get a fixed-size hashtable?\r
        }\r
 \r
        public void TestIsReadOnly() {\r
                Hashtable h = new Hashtable();\r
-               AssertEquals("hashtable not read-only by default",\r
-                            false, h.IsReadOnly);\r
+               Assert.AreEqual (false, h.IsReadOnly, "hashtable not read-only by default");\r
                // TODO - any way to get a read-only hashtable?\r
        }\r
 \r
@@ -145,13 +139,13 @@ public class HashtableTest : Assertion {
        public void TestIsSynchronized ()\r
        {\r
                Hashtable h = new Hashtable ();\r
-               Assert ("hashtable not synched by default", !h.IsSynchronized);\r
+               Assert.IsTrue (!h.IsSynchronized, "hashtable not synched by default");\r
 \r
                Hashtable h2 = Hashtable.Synchronized (h);\r
-               Assert ("hashtable should by synched", h2.IsSynchronized);\r
+               Assert.IsTrue (h2.IsSynchronized, "hashtable should by synched");\r
 \r
                Hashtable h3 = (Hashtable) h2.Clone ();\r
-               Assert ("Cloned Hashtable should by synched", h3.IsSynchronized);\r
+               Assert.IsTrue (h3.IsSynchronized, "Cloned Hashtable should by synched");\r
        }\r
 \r
         [Test]\r
@@ -163,10 +157,9 @@ public class HashtableTest : Assertion {
                                Object o = h[null];\r
                        } catch (ArgumentNullException e) {\r
                                errorThrown = true;\r
-                               AssertEquals("ParamName is not \"key\"", "key", e.ParamName);\r
+                               Assert.AreEqual ("key", e.ParamName, "ParamName is not \"key\"");\r
                        }\r
-                       Assert("null hashtable error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "null hashtable error not thrown");\r
                }\r
                // TODO - if read-only and/or fixed-size is possible,\r
                //        test 'NotSupportedException' here\r
@@ -176,8 +169,7 @@ public class HashtableTest : Assertion {
                        int max = 100;\r
                        for (int i = 1; i <= max; i++) {\r
                                h[i] = i;\r
-                               AssertEquals("value wrong for " + i,\r
-                                            i, h[i]);\r
+                               Assert.AreEqual (i, h[i], "value wrong for " + i);\r
                        }\r
                }\r
        }\r
@@ -193,27 +185,23 @@ public class HashtableTest : Assertion {
                for (int i = 0; i < keys.Length; i++) {\r
                        h1[keys[i]] = values1[i];\r
                }\r
-               AssertEquals("keys wrong size",\r
-                            keys.Length, h1.Keys.Count);\r
+               Assert.AreEqual (keys.Length, h1.Keys.Count, "keys wrong size");\r
                for (int i = 0; i < keys.Length; i++) {\r
                        h1[keys[i]] = values2[i];\r
                }\r
-               AssertEquals("keys wrong size 2",\r
-                            keys.Length, h1.Keys.Count);\r
+               Assert.AreEqual (keys.Length, h1.Keys.Count, "keys wrong size 2");\r
 \r
                // MS .NET Always returns the same reference when calling Keys property\r
                keysReference = h1.Keys;\r
            keysReference2 = h1.Keys;\r
-               AssertEquals("keys references differ", keysReference, keysReference2);\r
+               Assert.AreEqual (keysReference, keysReference2, "keys references differ");\r
 \r
                for (int i = 0; i < keys2.Length; i++) \r
                {\r
                        h1[keys2[i]] = values2[i];\r
                }\r
-               AssertEquals("keys wrong size 3",\r
-                       keys.Length+keys2.Length, h1.Keys.Count);\r
-               AssertEquals("keys wrong size 4",\r
-                       keys.Length+keys2.Length, keysReference.Count);\r
+               Assert.AreEqual (keys.Length+keys2.Length, h1.Keys.Count, "keys wrong size 3");\r
+               Assert.AreEqual (keys.Length+keys2.Length, keysReference.Count, "keys wrong size 4");\r
        }\r
 \r
        // TODO - SyncRoot\r
@@ -226,18 +214,16 @@ public class HashtableTest : Assertion {
                for (int i = 0; i < keys.Length; i++) {\r
                        h1[keys[i]] = values1[i];\r
                }\r
-               AssertEquals("values wrong size",\r
-                            keys.Length, h1.Values.Count);\r
+               Assert.AreEqual (keys.Length, h1.Values.Count, "values wrong size");\r
                for (int i = 0; i < keys.Length; i++) {\r
                        h1[keys[i]] = values2[i];\r
                }\r
-               AssertEquals("values wrong size 2",\r
-                            keys.Length, h1.Values.Count);\r
+               Assert.AreEqual (keys.Length, h1.Values.Count, "values wrong size 2");\r
 \r
                // MS .NET Always returns the same reference when calling Values property\r
                ICollection valuesReference1 = h1.Values;\r
                ICollection valuesReference2 = h1.Values;\r
-               AssertEquals("values references differ", valuesReference1, valuesReference2);\r
+               Assert.AreEqual (valuesReference1, valuesReference2, "values references differ");\r
        }\r
 \r
        [Test]\r
@@ -249,10 +235,9 @@ public class HashtableTest : Assertion {
                                h.Add(null, "huh?");\r
                        } catch (ArgumentNullException e) {\r
                                errorThrown = true;\r
-                               AssertEquals("ParamName is not 'key'", "key", e.ParamName);\r
+                               Assert.AreEqual ("key", e.ParamName, "ParamName is not 'key'");\r
                        }\r
-                       Assert("null add error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "null add error not thrown");\r
                }\r
                {\r
                        bool errorThrown = false;\r
@@ -263,8 +248,7 @@ public class HashtableTest : Assertion {
                        } catch (ArgumentException) {\r
                                errorThrown = true;\r
                        }\r
-                       Assert("re-add error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "re-add error not thrown");\r
                }\r
                // TODO - hit NotSupportedException\r
                {\r
@@ -272,8 +256,7 @@ public class HashtableTest : Assertion {
                        int max = 100;\r
                        for (int i = 1; i <= max; i++) {\r
                                h.Add(i, i);\r
-                               AssertEquals("value wrong for " + i,\r
-                                            i, h[i]);\r
+                               Assert.AreEqual (i, h[i], "value wrong for " + i);\r
                        }\r
                }\r
        }\r
@@ -282,15 +265,14 @@ public class HashtableTest : Assertion {
        public void TestClear() {\r
                // TODO - hit NotSupportedException\r
                Hashtable h = new Hashtable();\r
-               AssertEquals("new table - count zero", 0, h.Count);\r
+               Assert.AreEqual (0, h.Count, "new table - count zero");\r
                int max = 100;\r
                for (int i = 1; i <= max; i++) {\r
                        h[i] = i;\r
                }\r
-               Assert("table don't gots stuff", h.Count > 0);\r
+               Assert.IsTrue (h.Count > 0, "table don't gots stuff");\r
                h.Clear();\r
-               AssertEquals("Table should be cleared",\r
-                            0, h.Count);\r
+               Assert.AreEqual (0, h.Count, "Table should be cleared");\r
        }\r
 \r
 #if NET_2_0\r
@@ -316,11 +298,10 @@ public class HashtableTest : Assertion {
                                h1[c1[i]] = c2[i];\r
                        }\r
                        Hashtable h2 = (Hashtable)h1.Clone();\r
-                       AssertNotNull("got no clone!", h2);\r
-                       AssertNotNull("clone's got nothing!", h2[c1[0]]);\r
+                       Assert.IsNotNull (h2, "got no clone!");\r
+                       Assert.IsNotNull (h2[c1[0]], "clone's got nothing!");\r
                        for (int i = 0; i < c1.Length; i++) {\r
-                               AssertEquals("Hashtable match", \r
-                                            h1[c1[i]], h2[c1[i]]);\r
+                               Assert.AreEqual (h1[c1[i]], h2[c1[i]], "Hashtable match");\r
                        }\r
                }\r
                {\r
@@ -334,15 +315,14 @@ public class HashtableTest : Assertion {
                                h1[c1[i]] = c2[i];\r
                        }\r
                        Hashtable h2 = (Hashtable)h1.Clone();\r
-                       AssertNotNull("got no clone!", h2);\r
-                       AssertNotNull("clone's got nothing!", h2[c1[0]]);\r
+                       Assert.IsNotNull (h2, "got no clone!");\r
+                       Assert.IsNotNull (h2[c1[0]], "clone's got nothing!");\r
                        for (int i = 0; i < c1.Length; i++) {\r
-                               AssertEquals("Hashtable match", \r
-                                            h1[c1[i]], h2[c1[i]]);\r
+                               Assert.AreEqual (h1[c1[i]], h2[c1[i]], "Hashtable match");\r
                        }\r
 \r
                        ((char[])h1[c1[0]])[0] = 'z';\r
-                       AssertEquals("shallow copy", h1[c1[0]], h2[c1[0]]);\r
+                       Assert.AreEqual (h1[c1[0]], h2[c1[0]], "shallow copy");\r
 \r
 #if NET_2_0\r
                        // NET 2.0 stuff\r
@@ -351,9 +331,7 @@ public class HashtableTest : Assertion {
                        Hashtable mh1clone = (Hashtable) mh1.Clone ();\r
                        \r
                        // warning, depends on the field name.\r
-                       AssertEquals ("EqualityComparer",\r
-                               GetEqualityComparer (mh1),\r
-                               GetEqualityComparer (mh1clone));\r
+                       Assert.AreEqual (GetEqualityComparer (mh1), GetEqualityComparer (mh1clone), "EqualityComparer");\r
 #endif\r
                }\r
        }\r
@@ -367,10 +345,9 @@ public class HashtableTest : Assertion {
                                bool result = h.Contains(null);\r
                        } catch (ArgumentNullException e) {\r
                                errorThrown = true;\r
-                               AssertEquals("ParamName is not 'key'", "key", e.ParamName);\r
+                               Assert.AreEqual ("key", e.ParamName, "ParamName is not 'key'");\r
                        }\r
-                       Assert("null add error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "null add error not thrown");\r
                }\r
                {\r
                        Hashtable h = new Hashtable();\r
@@ -380,8 +357,8 @@ public class HashtableTest : Assertion {
                        }\r
                        for (int i = 0; i < 10000; i += 2) \r
                        {\r
-                               Assert("hashtable must contain"+i.ToString(), h.Contains(i));\r
-                               Assert("hashtable does not contain "+((int)(i+1)).ToString(), !h.Contains(i+1));\r
+                               Assert.IsTrue (h.Contains(i), "hashtable must contain"+i.ToString());\r
+                               Assert.IsTrue (!h.Contains(i+1), "hashtable does not contain "+((int)(i+1)).ToString());\r
                        }\r
                }\r
        }\r
@@ -398,10 +375,9 @@ public class HashtableTest : Assertion {
                        catch (ArgumentNullException e) \r
                        {\r
                                errorThrown = true;\r
-                               AssertEquals("ParamName is not 'key'", "key", e.ParamName);\r
+                               Assert.AreEqual ("key", e.ParamName, "ParamName is not 'key'");\r
                        }\r
-                       Assert("null add error not thrown", \r
-                               errorThrown);\r
+                       Assert.IsTrue (errorThrown, "null add error not thrown");\r
                }\r
                {\r
                        Hashtable h = new Hashtable();\r
@@ -411,8 +387,8 @@ public class HashtableTest : Assertion {
                        }\r
                        for (int i = 0; i < 1000; i += 2) \r
                        {\r
-                               Assert("hashtable must contain"+i.ToString(), h.Contains(i));\r
-                               Assert("hashtable does not contain "+((int)(i+1)).ToString(), !h.Contains(i+1));\r
+                               Assert.IsTrue (h.Contains(i), "hashtable must contain"+i.ToString());\r
+                               Assert.IsTrue (!h.Contains(i+1), "hashtable does not contain "+((int)(i+1)).ToString());\r
                        }\r
                }\r
 \r
@@ -423,15 +399,11 @@ public class HashtableTest : Assertion {
                {\r
                        Hashtable h = new Hashtable();\r
                        h['a'] = "blue";\r
-                       Assert("blue? it's in there!", \r
-                              h.ContainsValue("blue"));\r
-                       Assert("green? no way!", \r
-                              !h.ContainsValue("green"));\r
-                       Assert("null? no way!", \r
-                               !h.ContainsValue(null));\r
+                       Assert.IsTrue (h.ContainsValue("blue"), "blue? it's in there!");\r
+                       Assert.IsTrue (!h.ContainsValue("green"), "green? no way!");\r
+                       Assert.IsTrue (!h.ContainsValue(null), "null? no way!");\r
                        h['b'] = null;\r
-                       Assert("null? it's in there!", \r
-                               h.ContainsValue(null));\r
+                       Assert.IsTrue (h.ContainsValue(null), "null? it's in there!");\r
 \r
                }\r
        }\r
@@ -445,10 +417,9 @@ public class HashtableTest : Assertion {
                                h.CopyTo(null, 0);\r
                        } catch (ArgumentNullException e) {\r
                                errorThrown = true;\r
-                               AssertEquals("ParamName is not \"array\"", "array", e.ParamName); \r
+                               Assert.AreEqual ("array", e.ParamName, "ParamName is not \"array\""); \r
                        }\r
-                       Assert("null hashtable error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "null hashtable error not thrown");\r
                }\r
                {\r
                        bool errorThrown = false;\r
@@ -458,10 +429,9 @@ public class HashtableTest : Assertion {
                                h.CopyTo(o, -1);\r
                        } catch (ArgumentOutOfRangeException e) {\r
                                errorThrown = true;\r
-                               AssertEquals("ParamName is not \"arrayIndex\"", "arrayIndex", e.ParamName);\r
+                               Assert.AreEqual ("arrayIndex", e.ParamName, "ParamName is not \"arrayIndex\"");\r
                        }\r
-                       Assert("out of range error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "out of range error not thrown");\r
                }\r
                {\r
                        bool errorThrown = false;\r
@@ -472,8 +442,7 @@ public class HashtableTest : Assertion {
                        } catch (ArgumentException) {\r
                                errorThrown = true;\r
                        }\r
-                       Assert("multi-dim array error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "multi-dim array error not thrown");\r
                }\r
                {\r
                        bool errorThrown = false;\r
@@ -485,8 +454,7 @@ public class HashtableTest : Assertion {
                        } catch (ArgumentException) {\r
                                errorThrown = true;\r
                        }\r
-                       Assert("no room in array error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "no room in array error not thrown");\r
                }\r
                {\r
                        bool errorThrown = false;\r
@@ -500,8 +468,7 @@ public class HashtableTest : Assertion {
                        } catch (ArgumentException) {\r
                                errorThrown = true;\r
                        }\r
-                       Assert("table too big error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "table too big error not thrown");\r
                }\r
                {\r
                        bool errorThrown = false;\r
@@ -515,8 +482,7 @@ public class HashtableTest : Assertion {
                        } catch (InvalidCastException) {\r
                                errorThrown = true;\r
                        }\r
-                       Assert("invalid cast error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "invalid cast error not thrown");\r
                }\r
 \r
                {\r
@@ -532,10 +498,10 @@ public class HashtableTest : Assertion {
                                o[1] = v;\r
                        }\r
 #endif // TARGET_JVM\r
-                       AssertEquals("first copy fine.", 'a', o[0].Key);\r
-                       AssertEquals("first copy fine.", 1, o[0].Value);\r
-                       AssertEquals("second copy fine.", 'b', o[1].Key);\r
-                       AssertEquals("second copy fine.", 2, o[1].Value);\r
+                       Assert.AreEqual ('a', o[0].Key, "first copy fine.");\r
+                       Assert.AreEqual (1, o[0].Value, "first copy fine.");\r
+                       Assert.AreEqual ('b', o[1].Key, "second copy fine.");\r
+                       Assert.AreEqual (2, o[1].Value, "second copy fine.");\r
                }\r
        }\r
 \r
@@ -548,14 +514,12 @@ public class HashtableTest : Assertion {
                        h1[s1[i]] = c1[i];\r
                }\r
                IDictionaryEnumerator en = h1.GetEnumerator();\r
-               AssertNotNull("No enumerator", en);\r
+               Assert.IsNotNull (en, "No enumerator");\r
                \r
                for (int i = 0; i < s1.Length; i++) {\r
                        en.MoveNext();\r
-                       Assert("Not enumerating for " + en.Key, \r
-                              Array.IndexOf(s1, en.Key) >= 0);\r
-                       Assert("Not enumerating for " + en.Value, \r
-                              Array.IndexOf(c1, en.Value) >= 0);\r
+                       Assert.IsTrue (Array.IndexOf(s1, en.Key) >= 0, "Not enumerating for " + en.Key);\r
+                       Assert.IsTrue (Array.IndexOf(c1, en.Value) >= 0, "Not enumerating for " + en.Value);\r
                }\r
        }\r
 \r
@@ -575,7 +539,7 @@ public class HashtableTest : Assertion {
                \r
                bool result;\r
                foreach (DictionaryEntry de in table1)\r
-                       AssertEquals (de.Value, table2 [de.Key]);\r
+                       Assert.AreEqual (table2 [de.Key], de.Value);\r
        }\r
        \r
        [Test]\r
@@ -591,7 +555,7 @@ public class HashtableTest : Assertion {
                formatter.Serialize(stream, table);\r
                stream.Position = 0;\r
                table = (Hashtable) formatter.Deserialize(stream);\r
-               AssertEquals ("#1", 1, table.Count);\r
+               Assert.AreEqual (1, table.Count, "#1");\r
        }\r
 \r
         [Test]        \r
@@ -603,10 +567,9 @@ public class HashtableTest : Assertion {
                                h.Remove(null);\r
                        } catch (ArgumentNullException e) {\r
                                errorThrown = true;\r
-                               AssertEquals("ParamName is not \"key\"", "key", e.ParamName);\r
+                               Assert.AreEqual ("key", e.ParamName, "ParamName is not \"key\"");\r
                        }\r
-                       Assert("null hashtable error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "null hashtable error not thrown");\r
                }\r
                {\r
                        string[] keys = {"this", "is", "a", "test"};\r
@@ -615,17 +578,13 @@ public class HashtableTest : Assertion {
                        for (int i = 0; i < keys.Length; i++) {\r
                                h[keys[i]] = values[i];\r
                        }\r
-                       AssertEquals("not enough in table",\r
-                                    4, h.Count);\r
+                       Assert.AreEqual (4, h.Count, "not enough in table");\r
                        h.Remove("huh?");\r
-                       AssertEquals("not enough in table",\r
-                                    4, h.Count);\r
+                       Assert.AreEqual (4, h.Count, "not enough in table");\r
                        h.Remove("this");\r
-                       AssertEquals("Wrong count in table",\r
-                                    3, h.Count);\r
+                       Assert.AreEqual (3, h.Count, "Wrong count in table");\r
                        h.Remove("this");\r
-                       AssertEquals("Wrong count in table",\r
-                                    3, h.Count);\r
+                       Assert.AreEqual (3, h.Count, "Wrong count in table");\r
                }\r
        }\r
 \r
@@ -637,18 +596,15 @@ public class HashtableTest : Assertion {
                                Hashtable h = Hashtable.Synchronized(null);\r
                        } catch (ArgumentNullException e) {\r
                                errorThrown = true;\r
-                               AssertEquals("ParamName is not \"table\"", "table", e.ParamName);\r
+                               Assert.AreEqual ("table", e.ParamName, "ParamName is not \"table\"");\r
                        }\r
-                       Assert("null hashtable error not thrown", \r
-                              errorThrown);\r
+                       Assert.IsTrue (errorThrown, "null hashtable error not thrown");\r
                }\r
                {\r
                        Hashtable h = new Hashtable();\r
-                       Assert("hashtable not synced by default", \r
-                              !h.IsSynchronized);\r
+                       Assert.IsTrue (!h.IsSynchronized, "hashtable not synced by default");\r
                        Hashtable h2 = Hashtable.Synchronized(h);\r
-                       Assert("hashtable should by synced", \r
-                              h2.IsSynchronized);\r
+                       Assert.IsTrue (h2.IsSynchronized, "hashtable should by synced");\r
                }\r
        }\r
        \r
@@ -672,20 +628,20 @@ public class HashtableTest : Assertion {
         [Test]\r
        public void TestAddRemoveClear() {\r
                ht.Clear();\r
-               Assert(ht.Count==0);\r
+               Assert.IsTrue (ht.Count==0);\r
                \r
                SetDefaultData();\r
-               Assert(ht.Count==3);\r
+               Assert.IsTrue (ht.Count==3);\r
                \r
                bool thrown=false;\r
                try {\r
                        ht.Add("k2","cool");\r
                } catch (ArgumentException) {thrown=true;}\r
-               Assert("Must throw ArgumentException!",thrown);\r
+               Assert.IsTrue (thrown, "Must throw ArgumentException!");\r
                \r
                ht["k2"]="cool";\r
-               Assert(ht.Count==3);\r
-               Assert(ht["k2"].Equals("cool"));\r
+               Assert.IsTrue (ht.Count==3);\r
+               Assert.IsTrue (ht["k2"].Equals("cool"));\r
                \r
        }\r
 \r
@@ -694,14 +650,14 @@ public class HashtableTest : Assertion {
                SetDefaultData();\r
                Object[] entries=new Object[ht.Count];\r
                ht.CopyTo(entries,0);\r
-               Assert("Not an entry.",entries[0] is DictionaryEntry);\r
+               Assert.IsTrue (entries[0] is DictionaryEntry, "Not an entry.");\r
        }\r
 \r
        [Test]\r
        public void CopyTo_Empty ()\r
        {\r
                Hashtable ht = new Hashtable ();\r
-               AssertEquals ("Count", 0, ht.Count);\r
+               Assert.AreEqual (0, ht.Count, "Count");\r
                object[] array = new object [ht.Count];\r
                ht.CopyTo (array, 0);\r
        }\r
@@ -725,14 +681,14 @@ public class HashtableTest : Assertion {
                        }\r
                }\r
                \r
-               Assert(ht.Count==n);\r
+               Assert.IsTrue (ht.Count==n);\r
                \r
                for (int i=0;i<n;i++) {\r
                        String key=cache[i];\r
                        String val=ht[key] as String;\r
                        String err="ht[\""+key+"\"]=\""+val+\r
                                "\", expected \""+cache[i+max]+"\"";\r
-                       Assert(err,val!=null && val.Equals(cache[i+max]));\r
+                       Assert.IsTrue (val!=null && val.Equals(cache[i+max]), err);\r
                }\r
                \r
                int r1=(n/3);\r
@@ -745,32 +701,32 @@ public class HashtableTest : Assertion {
                \r
                for (int i=0;i<n;i++) {\r
                        if (i>=r1 && i<r2) {\r
-                               Assert(ht[cache[i]]==null);\r
+                               Assert.IsTrue (ht[cache[i]]==null);\r
                        } else {\r
                                String key=cache[i];\r
                                String val=ht[key] as String;\r
                                String err="ht[\""+key+"\"]=\""+val+\r
                                        "\", expected \""+cache[i+max]+"\"";\r
-                               Assert(err,val!=null && val.Equals(cache[i+max]));\r
+                               Assert.IsTrue (val!=null && val.Equals(cache[i+max]), err);\r
                        }\r
                }\r
                \r
                ICollection keys=ht.Keys;\r
                int nKeys=0;\r
                foreach (Object key in keys) {\r
-                       Assert((key as String) != null);\r
+                       Assert.IsTrue ((key as String) != null);\r
                        nKeys++;\r
                }\r
-               Assert(nKeys==ht.Count);\r
+               Assert.IsTrue (nKeys==ht.Count);\r
 \r
                \r
                ICollection vals=ht.Values;\r
                int nVals=0;\r
                foreach (Object val in vals) {\r
-                       Assert((val as String) != null);\r
+                       Assert.IsTrue ((val as String) != null);\r
                        nVals++;\r
                }\r
-               Assert(nVals==ht.Count);\r
+               Assert.IsTrue (nVals==ht.Count);\r
                \r
        }\r
 \r
@@ -787,11 +743,11 @@ public class HashtableTest : Assertion {
                Hashtable ciHashtable = new Hashtable(11,1.0f,CaseInsensitiveHashCodeProvider.Default,CaseInsensitiveComparer.Default);\r
                ciHashtable ["key1"] = "value";\r
                ciHashtable ["key2"] = "VALUE";\r
-               Assert(ciHashtable ["key1"].Equals ("value"));\r
-               Assert(ciHashtable ["key2"].Equals ("VALUE"));\r
+               Assert.IsTrue (ciHashtable ["key1"].Equals ("value"));\r
+               Assert.IsTrue (ciHashtable ["key2"].Equals ("VALUE"));\r
 \r
                ciHashtable ["KEY1"] = "new_value";\r
-               Assert(ciHashtable ["key1"].Equals ("new_value"));\r
+               Assert.IsTrue (ciHashtable ["key1"].Equals ("new_value"));\r
 \r
        }\r
 \r
@@ -802,7 +758,7 @@ public class HashtableTest : Assertion {
 \r
                Hashtable htCopy = new Hashtable (ht);\r
 \r
-               Assert(ht.Count == htCopy.Count);\r
+               Assert.IsTrue (ht.Count == htCopy.Count);\r
        }\r
 \r
         [Test]\r
@@ -814,7 +770,7 @@ public class HashtableTest : Assertion {
 \r
                while (e.MoveNext ()) {}\r
 \r
-               Assert (!e.MoveNext ());\r
+               Assert.IsTrue (!e.MoveNext ());\r
 \r
        }\r
 \r
@@ -845,10 +801,10 @@ public class HashtableTest : Assertion {
        {\r
                Hashtable ht = new Hashtable ();\r
                // see bug #76300\r
-               Assert ("Keys.IsSerializable", ht.Keys.GetType ().IsSerializable);\r
-               Assert ("Values.IsSerializable", ht.Values.GetType ().IsSerializable);\r
-               Assert ("GetEnumerator.IsSerializable", ht.GetEnumerator ().GetType ().IsSerializable);\r
-               Assert ("Synchronized.IsSerializable", Hashtable.Synchronized (ht).GetType ().IsSerializable);\r
+               Assert.IsTrue (ht.Keys.GetType ().IsSerializable, "Keys.IsSerializable");\r
+               Assert.IsTrue (ht.Values.GetType ().IsSerializable, "Values.IsSerializable");\r
+               Assert.IsTrue (ht.GetEnumerator ().GetType ().IsSerializable, "GetEnumerator.IsSerializable");\r
+               Assert.IsTrue (Hashtable.Synchronized (ht).GetType ().IsSerializable, "Synchronized.IsSerializable");\r
        }\r
 \r
        [Test]\r
index 76d4e730190c249e2764b9bc69c8d2b19c427d29..a07da619d2b489d25b60edbceacd4be218de5341 100644 (file)
@@ -16,7 +16,7 @@ using NUnit.Framework;
 namespace MonoTests.System.Collections {
 
        [TestFixture]
-       public class QueueTest : Assertion {
+       public class QueueTest {
 
                protected Queue q1;
                protected Queue q2;
@@ -36,172 +36,175 @@ namespace MonoTests.System.Collections {
                        emptyQueue = new Queue ();
                }
 
+               [Test]
                public void TestConstructorException1 () 
                {
                        try 
                        {
                                Queue q = new Queue(-1, 2);
-                               Fail("Should throw an exception");
+                               Assert.Fail ("Should throw an exception");
                        } catch (ArgumentOutOfRangeException e) {
-                               AssertEquals("Exception's ParamName must be \"capacity\"", "capacity", e.ParamName);
+                               Assert.AreEqual ("capacity", e.ParamName, "Exception's ParamName must be \"capacity\"");
                        }
                }
 
+               [Test]
                public void TestConstructorException2 () 
                {
                        try 
                        {
                                Queue q = new Queue(10, 0);
-                               Fail("Should throw an exception because growFactor < 1");
+                               Assert.Fail ("Should throw an exception because growFactor < 1");
                        } 
                        catch (ArgumentOutOfRangeException e) 
                        {
-                               AssertEquals("Exception's ParamName must be \"growFactor\"", "growFactor", e.ParamName);
+                               Assert.AreEqual ("growFactor", e.ParamName, "Exception's ParamName must be \"growFactor\"");
                        }
                }
 
+               [Test]
                public void TestConstructorException3 () 
                {
                        try 
                        {
                                Queue q = new Queue(10, 11);
-                               Fail("Should throw an exception because growFactor > 10");
+                               Assert.Fail ("Should throw an exception because growFactor > 10");
                        } 
                        catch (ArgumentOutOfRangeException e) 
                        {
-                               AssertEquals("Exception's ParamName must be \"growFactor\"", "growFactor", e.ParamName);
+                               Assert.AreEqual ("growFactor", e.ParamName, "Exception's ParamName must be \"growFactor\"");
                        }
                }
 
+               [Test]
                public void TestConstructorException4 () 
                {
                        try 
                        {
                                Queue q = new Queue(null);
-                               Fail("Should throw an exception because col == null");
+                               Assert.Fail ("Should throw an exception because col == null");
                        } 
                        catch (ArgumentNullException e) 
                        {
-                               AssertEquals("Exception's ParamName must be \"col\"", "col", e.ParamName);
+                               Assert.AreEqual ("col", e.ParamName, "Exception's ParamName must be \"col\"");
                        }
                }
 
+               [Test]
                public void TestICollectionConstructor () 
                {
                        Queue q = new Queue(new int[] {1, 2, 3, 4, 5});
-                       AssertEquals("count", 5, q.Count);
+                       Assert.AreEqual (5, q.Count, "count");
                        for (int i=1; i <=5; i++) 
                        {
-                               AssertEquals(i, q.Dequeue());
+                               Assert.AreEqual (q.Dequeue(), i);
                        }
                 }
 
+               [Test]
                public void TestConstructors () 
                {
-                       SetUp();
-                       Assert (q1.Count == 100);
-                       Assert (q2.Count == 50);
-                       Assert (emptyQueue.Count == 0);
+                       Assert.IsTrue (q1.Count == 100);
+                       Assert.IsTrue (q2.Count == 50);
+                       Assert.IsTrue (emptyQueue.Count == 0);
                }
 
+               [Test]
                public void TestCount() 
                {
-                       SetUp();
-
-                       AssertEquals("Count #1", 100, q1.Count);
+                       Assert.AreEqual (100, q1.Count, "Count #1");
                        for (int i = 1; i <=50; i ++) 
                        {
                                q1.Dequeue();
                        }
-                       AssertEquals("Count #2", 50, q1.Count);
+                       Assert.AreEqual (50, q1.Count, "Count #2");
                        for (int i = 1; i <=50; i ++) 
                        {
                                q1.Enqueue(i);
                        }
-                       AssertEquals("Count #3", 100, q1.Count);
+                       Assert.AreEqual (100, q1.Count, "Count #3");
 
-                       AssertEquals("Count #4", 50, q2.Count);
+                       Assert.AreEqual (50, q2.Count, "Count #4");
 
-                       AssertEquals("Count #5", 0, emptyQueue.Count);
+                       Assert.AreEqual (0, emptyQueue.Count, "Count #5");
                }
 
+               [Test]
                public void TestIsSynchronized() 
                {
-                       SetUp();
-                       Assert("IsSynchronized should be false", !q1.IsSynchronized);
-                       Assert("IsSynchronized should be false", !q2.IsSynchronized);
-                       Assert("IsSynchronized should be false", !emptyQueue.IsSynchronized);
+                       Assert.IsTrue (!q1.IsSynchronized, "IsSynchronized should be false");
+                       Assert.IsTrue (!q2.IsSynchronized, "IsSynchronized should be false");
+                       Assert.IsTrue (!emptyQueue.IsSynchronized, "IsSynchronized should be false");
                }
 
+               [Test]
                public void TestSyncRoot() 
                {
-                       SetUp();
 #if !NET_2_0 // umm, why on earth do you expect SyncRoot is the Queue itself?
-                       AssertEquals("SyncRoot q1", q1, q1.SyncRoot);
-                       AssertEquals("SyncRoot q2", q2, q2.SyncRoot);
-                       AssertEquals("SyncRoot emptyQueue", emptyQueue, emptyQueue.SyncRoot);
+                       Assert.AreEqual (q1, q1.SyncRoot, "SyncRoot q1");
+                       Assert.AreEqual (q2, q2.SyncRoot, "SyncRoot q2");
+                       Assert.AreEqual (emptyQueue, emptyQueue.SyncRoot, "SyncRoot emptyQueue");
 #endif
 
                        Queue q1sync = Queue.Synchronized(q1);
-                       AssertEquals("SyncRoot value of a synchronized queue", q1, q1sync.SyncRoot);
+                       Assert.AreEqual (q1, q1sync.SyncRoot, "SyncRoot value of a synchronized queue");
                }
 
+               [Test]
                public void TestCopyToException1 () 
                {
-                       SetUp();
                        try 
                        {
                                q1.CopyTo(null, 1);
-                               Fail("must throw ArgumentNullException");
+                               Assert.Fail ("must throw ArgumentNullException");
                        } catch (ArgumentNullException e) {
-                               AssertEquals("Exception's ParamName must be \"array\"", "array", e.ParamName);
+                               Assert.AreEqual ("array", e.ParamName, "Exception's ParamName must be \"array\"");
                        }
                }
 
 
+               [Test]
                public void TestCopyToException2 () 
                {
-                       SetUp();
                        try 
                        {
                                q1.CopyTo(new int[2,2], 1);
-                               Fail("must throw ArgumentException");
+                               Assert.Fail ("must throw ArgumentException");
                        } 
                        catch (ArgumentException) 
                        {
                        }
                }
 
+               [Test]
                public void TestCopyToException3 () 
                {
-                       SetUp();
                        try 
                        {
                                q1.CopyTo(new int[3], -1);
-                               Fail("must throw ArgumentOutOfRangeException");
+                               Assert.Fail ("must throw ArgumentOutOfRangeException");
                        } 
                        catch (ArgumentOutOfRangeException e) 
                        {
-                               AssertEquals("Exception's ParamName must be \"index\"", "index", e.ParamName);
+                               Assert.AreEqual ("index", e.ParamName, "Exception's ParamName must be \"index\"");
                        }
                }
 
+               [Test]
                public void TestCopyToException4 () 
                {
-                       SetUp();
                        try 
                        {
                                q1.CopyTo(new int[3], 1);
-                               Fail("must throw ArgumentException");
+                               Assert.Fail ("must throw ArgumentException");
                        } 
                        catch (ArgumentException) {}
                }
 
 
+               [Test]
                public void TestCopyTo () 
                {
-                       SetUp();
-
                        int[] a1 = new int[100];
                        int[] a2 = new int[60];
 
@@ -210,72 +213,72 @@ namespace MonoTests.System.Collections {
                                progress_marker = "before first CopyTo";
                                q1.CopyTo (a1, 0);
                                for (int i = 0; i < 100; i++)
-                                       AssertEquals (i, a1[i]);
+                                       Assert.AreEqual (a1[i], i);
 
                                // Remove some items from q2 and add other 
                                // items, to avoid having  an "easy" just created
                                // Queue
                                for (int i = 50; i < 60; i++)
-                                       Assert (i == (int) q2.Dequeue ());
+                                       Assert.IsTrue (i == (int) q2.Dequeue ());
                                for (int i = 100; i < 110; i++)
                                        q2.Enqueue (i);
                                
                                progress_marker = "before second CopyTo";
                                q2.CopyTo (a2, 10);
                                for (int i = 60; i < 110; i++)
-                                       Assert (i == a2[i - 60 + 10]);
+                                       Assert.IsTrue (i == a2[i - 60 + 10]);
                                
                                // Copying an empty Queue should not modify the array
                                progress_marker = "before third CopyTo";
                                emptyQueue.CopyTo (a2, 10);
                                for (int i = 60; i < 110; i++)
-                                       Assert (i == a2[i - 60 + 10]);
+                                       Assert.IsTrue (i == a2[i - 60 + 10]);
                        } catch (Exception e) {
-                               Fail ("Unexpected exception at marker <" + progress_marker + ">: e = " + e);
+                               Assert.Fail ("Unexpected exception at marker <" + progress_marker + ">: e = " + e);
                        }
 
                }
 
+               [Test]
                public void TestEnumerator () {
-                       SetUp();
                        int i;
                        IEnumerator e;
                        e = q1.GetEnumerator ();
                        i = 0;
                        while (e.MoveNext ()) {
-                               AssertEquals ("q1 at i=" + i, i, ((int) e.Current));
+                               Assert.AreEqual (i, ((int) e.Current), "q1 at i=" + i);
                                i++;
                        }
                        e = q2.GetEnumerator ();
                        i = 50;
                        while (e.MoveNext ()) {
-                               AssertEquals (i, ((int) e.Current));
+                               Assert.AreEqual (((int) e.Current), i);
                                i++;
                        }
                        e = emptyQueue.GetEnumerator ();
                        if (e.MoveNext ())
-                               Fail ("Empty Queue enumerator returning elements!");
+                               Assert.Fail ("Empty Queue enumerator returning elements!");
 
                        e = q1.GetEnumerator ();
                        try {
                                e.MoveNext ();
                                q1.Enqueue (0);
                                e.MoveNext ();
-                               Fail ("#1 Should have thrown InvalidOperationException");
+                               Assert.Fail ("#1 Should have thrown InvalidOperationException");
                        } catch (InvalidOperationException) { }
                        e = q1.GetEnumerator ();
                }
 
+               [Test]
                public void TestEnumeratorException1 () 
                {
-                       SetUp();
                        IEnumerator e;
 
                        e = q1.GetEnumerator();
                        q1.Enqueue(6);
                        try {
                                e.MoveNext();
-                               Fail("MoveNext must throw InvalidOperationException after Enqueue");
+                               Assert.Fail ("MoveNext must throw InvalidOperationException after Enqueue");
                        } catch (InvalidOperationException) {}
 
 
@@ -284,7 +287,7 @@ namespace MonoTests.System.Collections {
                        try 
                        {
                                e.Reset();
-                               Fail("Reset must throw InvalidOperationException after Enqueue");
+                               Assert.Fail ("Reset must throw InvalidOperationException after Enqueue");
                        } 
                        catch (InvalidOperationException) {}
 
@@ -293,7 +296,7 @@ namespace MonoTests.System.Collections {
                        try 
                        {
                                e.Reset();
-                               Fail("Reset must throw InvalidOperationException after TrimToSize");
+                               Assert.Fail ("Reset must throw InvalidOperationException after TrimToSize");
                        } 
                        catch (InvalidOperationException) {}
 
@@ -306,7 +309,7 @@ namespace MonoTests.System.Collections {
                        IEnumerator e = q1.GetEnumerator();
                        while (e.MoveNext ()) {
                        }
-                       AssertNotNull (e.Current);
+                       Assert.IsNotNull (e.Current);
                }
 
                [Test]
@@ -315,74 +318,75 @@ namespace MonoTests.System.Collections {
                        IEnumerator e = q1.GetEnumerator();
                        while (e.MoveNext ()) {
                        }
-                       Assert (!e.MoveNext ());
+                       Assert.IsTrue (!e.MoveNext ());
                }
 
+               [Test]
                public void TestClone () {
-                       SetUp();
                        Queue q3 = (Queue) q2.Clone ();
-                       Assert (q3.Count == q2.Count);
+                       Assert.IsTrue (q3.Count == q2.Count);
                        for (int i = 0; i < 50; i++)
-                               Assert (q2.Dequeue ().Equals (q3.Dequeue ()));
-                       Assert (q3.Count == 0);
-                       Assert (q2.Count == 0);
+                               Assert.IsTrue (q2.Dequeue ().Equals (q3.Dequeue ()));
+                       Assert.IsTrue (q3.Count == 0);
+                       Assert.IsTrue (q2.Count == 0);
                }
 
+               [Test]
                public void TestClear () {
-                       SetUp();
                        q1.Clear ();
-                       Assert (q1.Count == 0);
+                       Assert.IsTrue (q1.Count == 0);
                        q2.Clear ();
-                       Assert (q2.Count == 0);
+                       Assert.IsTrue (q2.Count == 0);
                        emptyQueue.Clear ();
-                       Assert (emptyQueue.Count == 0);
+                       Assert.IsTrue (emptyQueue.Count == 0);
                }
 
+               [Test]
                public void TestContains () {
-                       SetUp();
                        for (int i = 0; i < 100; i++) {
-                               Assert (q1.Contains (i));
-                               Assert (!emptyQueue.Contains (i));
+                               Assert.IsTrue (q1.Contains (i));
+                               Assert.IsTrue (!emptyQueue.Contains (i));
                                if (i < 50)
-                                       Assert (!q2.Contains (i));
+                                       Assert.IsTrue (!q2.Contains (i));
                                else
-                                       Assert (q2.Contains (i));
+                                       Assert.IsTrue (q2.Contains (i));
                        }
                        
-                       Assert("q1 does not contain null", !q1.Contains(null));
+                       Assert.IsTrue (!q1.Contains(null), "q1 does not contain null");
                        q1.Enqueue(null);
-                       Assert("q1 contains null", q1.Contains(null));
+                       Assert.IsTrue (q1.Contains(null), "q1 contains null");
                }
                
+               [Test]
                public void TestEnqueueDequeuePeek () {
-                       SetUp();
                        int q1size = q1.Count;
                        int q2size = q2.Count;
                        q2.Enqueue (null);
-                       Assert (q2.Count == ++q2size);
+                       Assert.IsTrue (q2.Count == ++q2size);
                        for (int i = 0; i < 50; i++) {
                                int k = (int) q1.Peek ();
-                               Assert (q1.Count == q1size);
+                               Assert.IsTrue (q1.Count == q1size);
                                int j = (int) q1.Dequeue ();
-                               Assert (q1.Count == --q1size);
-                               Assert (i == j);
-                               Assert (j == k);
+                               Assert.IsTrue (q1.Count == --q1size);
+                               Assert.IsTrue (i == j);
+                               Assert.IsTrue (j == k);
                                q2.Enqueue (j);
-                               Assert (q2.Count == ++q2size);
+                               Assert.IsTrue (q2.Count == ++q2size);
                        }
                        for (int i = 50; i < 100; i++) {
-                               Assert (((int) q2.Dequeue ()) == i);
-                               Assert (q2.Count == --q2size);
+                               Assert.IsTrue (((int) q2.Dequeue ()) == i);
+                               Assert.IsTrue (q2.Count == --q2size);
                        }
-                       Assert (q2.Peek () == null);
-                       Assert (q2.Dequeue () == null);
-                       Assert (q2.Count == --q2size);
+                       Assert.IsTrue (q2.Peek () == null);
+                       Assert.IsTrue (q2.Dequeue () == null);
+                       Assert.IsTrue (q2.Count == --q2size);
                        for (int i = 0; i < 50; i++) {
-                               Assert (((int) q2.Dequeue ()) == i);
-                               Assert (q2.Count == --q2size);
+                               Assert.IsTrue (((int) q2.Dequeue ()) == i);
+                               Assert.IsTrue (q2.Count == --q2size);
                        }
                }
                
+               [Test]
                public void TestDequeue() {
                        Queue queue = new Queue();
                        string[] tmp = new string[50];
@@ -395,11 +399,12 @@ namespace MonoTests.System.Collections {
                        i = 0;
                        while(queue.Count>0){
                                string z = (string) queue.Dequeue();
-                               AssertEquals (tmp[i], tmp[i], z);
+                               Assert.AreEqual (tmp[i], z, tmp[i]);
                                i++;
                        }
                }
 
+               [Test]
                [ExpectedException(typeof(InvalidOperationException))]
                public void TestDequeueEmpty() 
                {
@@ -407,22 +412,22 @@ namespace MonoTests.System.Collections {
                        q.Dequeue();
                }
 
+               [Test]
                public void TestToArray() 
                {
-                       SetUp();
                        object[] a = q1.ToArray();
                        for (int i = 0; i < 100; i++) 
                        {
-                               AssertEquals("Queue-Array mismatch",q1.Dequeue(),(int) a[i]);
+                               Assert.AreEqual (q1.Dequeue(), (int) a[i], "Queue-Array mismatch");
                        }
 
                        object[] b = emptyQueue.ToArray();
-                       AssertEquals("b should be a zero-lenght array", 0, b.Length); 
+                       Assert.AreEqual (0, b.Length, "b should be a zero-lenght array"); 
                }
 
+               [Test]
                public void TestTrimToSize() 
                {
-                       SetUp();
                        for (int i=0; i < 50; i++) 
                        {
                                q1.Dequeue();
@@ -433,16 +438,17 @@ namespace MonoTests.System.Collections {
 
                // TODO: test Syncronized operation
 
+               [Test]
                public void TestSynchronizedException() 
                {
                        try 
                        {
                                Queue.Synchronized(null);
-                               Fail("Must throw ArgumentNullException");
+                               Assert.Fail ("Must throw ArgumentNullException");
                        } 
                        catch (ArgumentNullException e)
                        {
-                               AssertEquals("Exception's ParamName must be \"queue\"", "queue", e.ParamName);
+                               Assert.AreEqual ("queue", e.ParamName, "Exception's ParamName must be \"queue\"");
                        }
                }
                
@@ -459,16 +465,16 @@ namespace MonoTests.System.Collections {
                public void SynchronizedClone () 
                {
                        Queue q1sync = Queue.Synchronized (q1);
-                       Assert ("q1sync.IsSyncronized", q1sync.IsSynchronized); 
-                       AssertEquals ("q1sync.Count", q1.Count, q1sync.Count);
+                       Assert.IsTrue (q1sync.IsSynchronized, "q1sync.IsSyncronized"); 
+                       Assert.AreEqual (q1.Count, q1sync.Count, "q1sync.Count");
 
                        Queue q1syncsync = Queue.Synchronized (q1sync);
-                       Assert ("q1syncsync must be synchronized too", q1syncsync.IsSynchronized);
-                       AssertEquals ("q1syncsync.Count", q1.Count, q1syncsync.Count);
+                       Assert.IsTrue (q1syncsync.IsSynchronized, "q1syncsync must be synchronized too");
+                       Assert.AreEqual (q1.Count, q1syncsync.Count, "q1syncsync.Count");
 
                        Queue q1syncclone = (Queue) q1sync.Clone();
-                       Assert ("clone must be synchronized too", q1syncclone.IsSynchronized);
-                       AssertEquals ("q1syncclone.Count", q1.Count, q1syncclone.Count);
+                       Assert.IsTrue (q1syncclone.IsSynchronized, "clone must be synchronized too");
+                       Assert.AreEqual (q1.Count, q1syncclone.Count, "q1syncclone.Count");
                }
 
                [Test]          
@@ -487,16 +493,16 @@ namespace MonoTests.System.Collections {
                                queue.Enqueue (i);
 
                        queue.TrimToSize ();
-                       AssertEquals ("0", 0, queue.Dequeue ());
+                       Assert.AreEqual (0, queue.Dequeue (), "0");
                        queue.Enqueue (411);
 
-                       AssertEquals ("Count-1", 31, queue.Count);
+                       Assert.AreEqual (31, queue.Count, "Count-1");
                        for (int i = 1; i < 31; i++) {
-                               AssertEquals ("Peek" + i.ToString (), i, queue.Peek ());
-                               AssertEquals ("Dequeue" + i.ToString (), i, queue.Dequeue ());
+                               Assert.AreEqual (i, queue.Peek (), "Peek" + i.ToString ());
+                               Assert.AreEqual (i, queue.Dequeue (), "Dequeue" + i.ToString ());
                        }
-                       AssertEquals ("Count-2", 1, queue.Count);
-                       AssertEquals ("411", 411, queue.Dequeue ());
+                       Assert.AreEqual (1, queue.Count, "Count-2");
+                       Assert.AreEqual (411, queue.Dequeue (), "411");
                }
 
                [Test]
@@ -508,8 +514,8 @@ namespace MonoTests.System.Collections {
 
                        queue.TrimToSize ();
                        queue.Enqueue (411);
-                       AssertEquals ("Count-1", 32, queue.Count);
-                       AssertEquals ("0", 0, queue.Dequeue ());
+                       Assert.AreEqual (32, queue.Count, "Count-1");
+                       Assert.AreEqual (0, queue.Dequeue (), "0");
                }
        }
 }
index 5ad657e1d947ac7261ae18110995f5e36fa363a0..3e40dfb98116470187c892a12fc0677a948cd332 100644 (file)
@@ -16,27 +16,30 @@ using NUnit.Framework;
 namespace MonoTests.System.Collections
 {
        [TestFixture]
-       public class StackTest: Assertion
+       public class StackTest
        {
                 private Stack stack1;
                 private Stack stack2;
                 private Stack stackInt;
 
+               [Test]
                 public void TestConstructor()
                 {
-                        AssertEquals(false, stack1 == null);
+                        Assert.AreEqual (stack1 == null, false);
                 }
                 
+               [Test]
                 public void TestICollectionConstructor1()
                 {
                         Stack stackTest = new Stack(new int[] {0, 1, 2, 3, 4});
 
                         for (int i = 4; i >= 0; i--)
-                                AssertEquals(i, stackTest.Pop());
+                                Assert.AreEqual (stackTest.Pop(), i);
 
-                        AssertEquals(0, stackTest.Count);
+                        Assert.AreEqual (stackTest.Count, 0);
                 }
 
+               [Test]
                public void TestICollectionConstructor2()
                {
                        bool exceptionThrown = false;
@@ -44,19 +47,21 @@ namespace MonoTests.System.Collections
                                Stack stackTest = new Stack(null);
                        } catch (ArgumentNullException e) {
                                exceptionThrown = true;
-                               AssertEquals("ParamName must be \"col\"","col",e.ParamName);
+                               Assert.AreEqual ("col", e.ParamName, "ParamName must be \"col\"");
                        }
-                       Assert("null argument must throw ArgumentNullException", exceptionThrown);
+                       Assert.IsTrue (exceptionThrown, "null argument must throw ArgumentNullException");
                                        
                }
 
+               [Test]
                 public void TestIntConstructor1()
                 {
                         Stack stackTest = new Stack(50);
 
-                        Assert(stackTest != null);
+                        Assert.IsTrue (stackTest != null);
                 }
 
+               [Test]
                public void TestIntConstructor2()
                {
                        bool exceptionThrown = false;
@@ -66,11 +71,12 @@ namespace MonoTests.System.Collections
                        catch (ArgumentOutOfRangeException e) 
                        {
                                exceptionThrown = true;
-                               AssertEquals("ParamName must be \"initialCapacity\"","initialCapacity",e.ParamName);
+                               Assert.AreEqual ("initialCapacity", e.ParamName, "ParamName must be \"initialCapacity\"");
                        }
-                       Assert("negative argument must throw ArgumentOutOfRangeException", exceptionThrown);
+                       Assert.IsTrue (exceptionThrown, "negative argument must throw ArgumentOutOfRangeException");
                }
 
+               [Test]
                 public void TestCount()
                 {
                         Stack stackTest = new Stack();
@@ -80,20 +86,23 @@ namespace MonoTests.System.Collections
                         stackTest.Push(0);
                         stackTest.Push(50);
 
-                        AssertEquals(4, stackTest.Count);
+                        Assert.AreEqual (stackTest.Count, 4);
                 }
 
+               [Test]
                 public void TestIsSyncronized()
                 {
-                        AssertEquals(false, stack1.IsSynchronized);
-                        AssertEquals(true, Stack.Synchronized(stack1).IsSynchronized);
+                        Assert.AreEqual (stack1.IsSynchronized, false);
+                        Assert.AreEqual (Stack.Synchronized(stack1).IsSynchronized, true);
                 }
 
+               [Test]
                 public void TestSyncRoot()
                 {
-                        AssertEquals(false, stack1.SyncRoot == null);
+                        Assert.AreEqual (stack1.SyncRoot == null, false);
                 }
 
+               [Test]
                 public void TestGetEnumerator1()
                 {
                         stackInt.Pop();
@@ -102,16 +111,17 @@ namespace MonoTests.System.Collections
 
                         foreach (int i in stackInt)
                         {
-                                AssertEquals(j--, i);
+                                Assert.AreEqual (i, j--);
                         }
 
                         stackInt.Clear();
 
                         IEnumerator e = stackInt.GetEnumerator();
 
-                        AssertEquals(false, e.MoveNext());
+                        Assert.AreEqual (e.MoveNext(), false);
                 }
 
+               [Test]
                public void TestGetEnumerator2()
                {
                        
@@ -120,10 +130,11 @@ namespace MonoTests.System.Collections
                        {
                                // Tests InvalidOperationException if enumerator is uninitialized
                                Object o = e.Current;
-                               Fail("InvalidOperationException should be thrown");
+                               Assert.Fail ("InvalidOperationException should be thrown");
                        } catch (InvalidOperationException) {}
                }
 
+               [Test]
                public void TestGetEnumerator3()
                {
                        
@@ -133,30 +144,32 @@ namespace MonoTests.System.Collections
                        {
                                // Tests InvalidOperationException if enumeration has ended
                                Object o = e.Current;
-                               Fail("InvalidOperationException should be thrown");
+                               Assert.Fail ("InvalidOperationException should be thrown");
                        } catch (InvalidOperationException) {}
                }
        
+               [Test]
                public void TestEnumeratorReset1() 
                {
                        IEnumerator e = stackInt.GetEnumerator();
 
                        e.MoveNext();
-                       AssertEquals("current value", 4, e.Current);
+                       Assert.AreEqual (4, e.Current, "current value");
                        e.MoveNext();
 
                        e.Reset();
 
                        e.MoveNext();
-                       AssertEquals("current value after reset", 4, e.Current);
+                       Assert.AreEqual (4, e.Current, "current value after reset");
                }
 
+               [Test]
                public void TestEnumeratorReset2() 
                {
                        IEnumerator e = stackInt.GetEnumerator();
 
                        e.MoveNext();
-                       AssertEquals("current value", 4, e.Current);
+                       Assert.AreEqual (4, e.Current, "current value");
 
                        // modifies underlying the stack. Reset must throw InvalidOperationException
                        stackInt.Push(5);
@@ -164,11 +177,12 @@ namespace MonoTests.System.Collections
                        try 
                        {
                                e.Reset();
-                               Fail("InvalidOperationException should be thrown");
+                               Assert.Fail ("InvalidOperationException should be thrown");
                        } 
                        catch (InvalidOperationException) {}
                }
 
+               [Test]
                public void TestEnumeratorMoveNextException() 
                {
                        IEnumerator e = stackInt.GetEnumerator();
@@ -179,29 +193,32 @@ namespace MonoTests.System.Collections
                        try 
                        {
                                e.MoveNext();
-                               Fail("InvalidOperationException should be thrown");
+                               Assert.Fail ("InvalidOperationException should be thrown");
                        } 
                        catch (InvalidOperationException) {}
                }
 
 
+               [Test]
                 public void TestClear()
                 {
                         stackInt.Clear();
 
-                        AssertEquals(0, stackInt.Count);
+                        Assert.AreEqual (stackInt.Count, 0);
                 }
 
+               [Test]
                 public void TestClone()
                 {
                         Stack clone = (Stack)stackInt.Clone();
 
                         while (stackInt.Count > 0)
                         {
-                                AssertEquals(stackInt.Pop(), clone.Pop());
+                                Assert.AreEqual (clone.Pop(), stackInt.Pop());
                         }
                 }
 
+               [Test]
                 public void TestContains()
                 {
                         string toLocate = "test";
@@ -213,28 +230,29 @@ namespace MonoTests.System.Collections
 
                        stackInt.Push(null);
 
-                       Assert(stackInt.Contains(toLocate));
+                       Assert.IsTrue (stackInt.Contains(toLocate));
 
-                       Assert("must contain null", stackInt.Contains(null));
+                       Assert.IsTrue (stackInt.Contains(null), "must contain null");
 
                        stackInt.Pop();
 
                         stackInt.Pop();
 
-                        Assert(stackInt.Contains(toLocate));
+                        Assert.IsTrue (stackInt.Contains(toLocate));
 
                         stackInt.Pop();
 
-                        Assert(!stackInt.Contains(toLocate));
+                        Assert.IsTrue (!stackInt.Contains(toLocate));
                        
                        stackInt.Push(null);
-                       Assert(stackInt.Contains(null));
+                       Assert.IsTrue (stackInt.Contains(null));
                        stackInt.Pop();
-                       Assert(!stackInt.Contains(null));
+                       Assert.IsTrue (!stackInt.Contains(null));
                        
                        
                 }
 
+               [Test]
                 public void TestCopyTo()
                 {
                         int[] arr = new int[stackInt.Count - 1];
@@ -243,46 +261,46 @@ namespace MonoTests.System.Collections
                         try 
                         {
                                 stackInt.CopyTo(null, 0);
-                                Fail("Should throw an ArgumentNullException");
+                                Assert.Fail ("Should throw an ArgumentNullException");
                         } catch (ArgumentNullException e) {
-                               AssertEquals("ParamName must be \"array\"","array",e.ParamName);
+                               Assert.AreEqual ("array", e.ParamName, "ParamName must be \"array\"");
                        }
 
                         try
                         {
                                 stackInt.CopyTo(arr, -1);
-                                Fail("Should throw an ArgumentOutOfRangeException");
+                                Assert.Fail ("Should throw an ArgumentOutOfRangeException");
                         } 
                        catch (ArgumentOutOfRangeException e) 
                        {
-                               AssertEquals("ParamName must be \"index\"","index",e.ParamName);
+                               Assert.AreEqual ("index", e.ParamName, "ParamName must be \"index\"");
                        }
 
                         try
                         {
                                 stackInt.CopyTo(arrMulti = new int[1, 1], 1);
-                                Fail("Should throw an ArgumentException");
+                                Assert.Fail ("Should throw an ArgumentException");
                         } 
                         catch (ArgumentException) {}
 
                         try
                         {
                                 stackInt.CopyTo(arr = new int[2], 3);
-                                Fail("Should throw an ArgumentException");
+                                Assert.Fail ("Should throw an ArgumentException");
                         } 
                         catch (ArgumentException) {}
 
                         try
                         {
                                 stackInt.CopyTo(arr = new int[3], 2);
-                                Fail("Should throw an ArgumentException");
+                                Assert.Fail ("Should throw an ArgumentException");
                         } 
                         catch (ArgumentException) {}
 
                         try
                         {
                                 stackInt.CopyTo(arr = new int[2], 3);
-                                Fail("Should throw an ArgumentException");
+                                Assert.Fail ("Should throw an ArgumentException");
                         } 
                         catch (ArgumentException) {}
 
@@ -294,10 +312,11 @@ namespace MonoTests.System.Collections
 
                         for (int i = 0; i < 4; i++)
                         {
-                               AssertEquals(j--, arr[i]);
+                               Assert.AreEqual (arr[i], j--);
                         }
                 }
 
+               [Test]
                 public void TestSyncronized()
                 {
                         Stack syncStack = Stack.Synchronized(stackInt);
@@ -305,53 +324,57 @@ namespace MonoTests.System.Collections
                         syncStack.Push(5);
 
                         for (int i = 5; i >= 0; i--)
-                                AssertEquals(i, syncStack.Pop());
+                                Assert.AreEqual (syncStack.Pop(), i);
                 }
 
+               [Test]
                 public void TestPushPeekPop()
                 {
                         stackInt.Pop();
 
                         int topVal = (int)stackInt.Peek();
 
-                        AssertEquals(3, topVal);
+                        Assert.AreEqual (topVal, 3);
 
-                        AssertEquals(4, stackInt.Count);
+                        Assert.AreEqual (stackInt.Count, 4);
 
-                        AssertEquals(topVal, stackInt.Pop());
+                        Assert.AreEqual (stackInt.Pop(), topVal);
 
-                        AssertEquals(2, stackInt.Pop());
+                        Assert.AreEqual (stackInt.Pop(), 2);
 
                         Stack test = new Stack();
                         test.Push(null);
 
-                        AssertEquals(null, test.Pop());
+                        Assert.AreEqual (test.Pop(), null);
 
                 }
                
+               [Test]
                public void TestPop()
                {
                        for (int i = 4; i >= 0; i--) 
                        {
-                               AssertEquals(i, stackInt.Pop());
+                               Assert.AreEqual (stackInt.Pop(), i);
                        }
                        try {
                                stackInt.Pop();
-                               Fail("must throw InvalidOperationException");
+                               Assert.Fail ("must throw InvalidOperationException");
                        } catch (InvalidOperationException){
                        }
                }
 
+               [Test]
                 public void TestToArray()
                 {
                         object[] arr = stackInt.ToArray();
 
-                        AssertEquals(stackInt.Count, arr.Length);                       
+                        Assert.AreEqual (arr.Length, stackInt.Count);                       
 
                         for (int i = 0; i < 5; i++)
-                                AssertEquals(arr[i], stackInt.Pop());
+                                Assert.AreEqual (stackInt.Pop(), arr[i]);
                 }
                
+               [Test]
                public void TestResize()
                {
                        Stack myStack = new Stack(20);
@@ -359,16 +382,17 @@ namespace MonoTests.System.Collections
                        for (int i = 0; i < 500; i++) 
                        {
                                myStack.Push(i);
-                               AssertEquals("push count test",i+1, myStack.Count);
+                               Assert.AreEqual (i+1, myStack.Count, "push count test");
                        }
                        
                        for (int i = 499; i >= 0; i--) 
                        {
-                               AssertEquals(i, myStack.Pop());
-                               AssertEquals("pop count test",i, myStack.Count);
+                               Assert.AreEqual (myStack.Pop(), i);
+                               Assert.AreEqual (i, myStack.Count, "pop count test");
                        }
                }
 
+               [Test]
                public void TestEmptyCopyTo ()
                {
                        Stack stack = new Stack ();