Merge pull request #3135 from kumpera/enable_conc_gc_on_mainline_archs
authorRodrigo Kumpera <kumpera@gmail.com>
Wed, 8 Jun 2016 22:33:27 +0000 (15:33 -0700)
committerRodrigo Kumpera <kumpera@gmail.com>
Wed, 8 Jun 2016 22:33:27 +0000 (15:33 -0700)
[jenkins] Make the concurrent GC the default on mainline archtectures.

60 files changed:
Makefile.am
autogen.sh
mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs
mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD2Test.cs
mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD4Test.cs
mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD5Test.cs
mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/SHA1Test.cs
mcs/class/Mono.Security/Test/Mono.Math/BigIntegerSetTest.cs
mcs/class/Mono.Security/Test/Mono.Math/PrimeTestingTest.cs
mcs/class/Mono.Security/Test/Mono.Math/SearchGeneratorTest.cs
mcs/class/Mono.Security/Test/Mono.Security.Authenticode/PrivateKeyTest.cs
mcs/class/Mono.Security/Test/Mono.Security.Cryptography/CryptoConvertTest.cs
mcs/class/Mono.Security/Test/Mono.Security.Cryptography/DiffieHellmanManagedTest.cs
mcs/class/Mono.Security/Test/Mono.Security.Cryptography/PKCS8Test.cs
mcs/class/Mono.Security/Test/Mono.Security.Protocol.Ntlm/ChallengeResponseTest.cs
mcs/class/Mono.Security/Test/Mono.Security.Protocol.Ntlm/MessageBaseTest.cs
mcs/class/Mono.Security/Test/Mono.Security.Protocol.Ntlm/Type1MessageTest.cs
mcs/class/Mono.Security/Test/Mono.Security.Protocol.Ntlm/Type2MessageTest.cs
mcs/class/Mono.Security/Test/Mono.Security.Protocol.Ntlm/Type3MessageTest.cs
mcs/class/Mono.Security/Test/Mono.Security/StrongNameTest.cs
mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest2.cs
mcs/class/System.Data/Test/System.Data/DataRowTest.cs
mcs/class/System.Data/Test/System.Data/DataRowViewTest.cs
mcs/class/System.Data/Test/System.Data/DataTableCollectionTest.cs
mcs/class/System.Data/Test/System.Data/DataViewManagerTest.cs
mcs/class/System.Data/Test/System.Data/DataViewTest.cs
mcs/class/System.Data/Test/System.Data/ForeignKeyConstraintTest.cs
mcs/class/System.Data/Test/System.Xml/XmlDataDocumentTest2.cs
mcs/class/System.Runtime.Serialization.Formatters.Soap/Test/InternalSoapValuesTest.cs
mcs/class/System.Runtime.Serialization.Formatters.Soap/Test/SerializationTest.cs
mcs/class/System.Runtime.Serialization.Formatters.Soap/Test/SoapFormatterTest.cs
mcs/class/System/System.Net.Sockets/SafeSocketHandle.cs
mcs/class/System/System.Net.Sockets/Socket.cs
mcs/class/System/Test/System.ComponentModel.Design.Serialization/InstanceDescriptorTest.cs
mcs/class/System/Test/System.Net.Sockets/SocketAsyncTest.cs
mcs/class/System/Test/System.Net/HttpListener2Test.cs
mcs/class/System/Test/System.Net/HttpWebRequestTest.cs
mcs/class/System/Test/System.Timers/TimerTest.cs
mcs/class/corlib/System/Environment.cs
mcs/class/corlib/Test/Mono.Math/ArithmeticBigTest.cs
mcs/class/corlib/Test/Mono.Math/PrimeTestingTest.cs
mcs/class/corlib/Test/System.Collections/SortedListTest.cs
mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs
mcs/class/corlib/Test/System/ConvertTest.cs
mcs/class/corlib/Test/System/EnvironmentTest.cs
mcs/class/doc/NUnitGuidelines
mcs/errors/cs0121-28.cs [new file with mode: 0644]
mcs/mcs/ecore.cs
mcs/tests/test-935.cs
mcs/tests/ver-il-net_4_x.xml
mono/io-layer/sockets.c
mono/metadata/appdomain.c
mono/metadata/coree.c
mono/metadata/object-internals.h
mono/metadata/object.c
mono/metadata/object.h
mono/metadata/socket-io.c
mono/metadata/socket-io.h
mono/mini/driver.c
mono/mini/mini-llvm.c

index 5afacfa7fcc0ddbba6dd7cd91bf7df6f5f9a475c..c0672460ea05b19b410a140f5790651cafd6b6cf 100644 (file)
@@ -5,15 +5,15 @@ AM_CFLAGS = $(WERROR_CFLAGS)
 MONOTOUCH_SUBDIRS = $(libgc_dir) eglib/src mono
 
 if CROSS_COMPILING
-SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) acceptance-tests
+SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) acceptance-tests llvm
 # Keep in sync with SUBDIRS
 ## 'tools' is not normally built
-DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs acceptance-tests
+DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs acceptance-tests llvm
 else
-SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) acceptance-tests
+SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) acceptance-tests llvm
 # Keep in sync with SUBDIRS
 ## 'tools' is not normally built
-DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs acceptance-tests
+DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs acceptance-tests llvm
 endif
 
 all: update_submodules
index 56070510746a3d4063b849d408551e736700a683..2fe9281e8dd4029b883d0512759afa962128e57b 100755 (executable)
@@ -160,8 +160,9 @@ if test -d $srcdir/eglib; then
   echo Done running eglib/autogen.sh ...
 fi
 
-
-echo "MONO_EXTRA_CONFIGURE_FLAGS is $MONO_EXTRA_CONFIGURE_FLAGS"
+if test x$MONO_EXTRA_CONFIGURE_FLAGS != x; then
+       echo "MONO_EXTRA_CONFIGURE_FLAGS is $MONO_EXTRA_CONFIGURE_FLAGS"
+fi
 
 conf_flags="$MONO_EXTRA_CONFIGURE_FLAGS --enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
 
index 74fc4a03cf2cbd4605da80b3f3059eec57089057..8c414dad79feaced6c3d48e6a4b7ff4865e0e3ff 100644 (file)
@@ -120,7 +120,8 @@ namespace MonoTests.EvaluatorTest
                        Evaluator.Run ("var a = new int[]{1,2,3};");
 
                        object res = Evaluator.Evaluate ("from x in a select x + 1;");
-                       CollectionAssert.AreEqual (new int[] { 2, 3, 4 }, ((IEnumerable<int>) res).ToArray ());
+
+                       Assert.AreEqual (new int[] { 2, 3, 4 }, ((IEnumerable<int>) res).ToArray ());
                }
 
                [Test]
@@ -201,4 +202,4 @@ namespace MonoTests.EvaluatorTest
                }
 
        }
-}
\ No newline at end of file
+}
index a6a92f06430cf0b88a0d535b86db36d8a03f4c60..65b46010fc384b28a5a9b844b25ce1cf24e189e8 100644 (file)
@@ -31,9 +31,9 @@ public class MD2Test {
                if ((array1 == null) && (array2 == null))
                        return;
                if (array1 == null)
-                       Assertion.Fail (msg + " -> First array is NULL");
+                       Assert.Fail (msg + " -> First array is NULL");
                if (array2 == null)
-                       Assertion.Fail (msg + " -> Second array is NULL");
+                       Assert.Fail (msg + " -> Second array is NULL");
         
                bool a = (array1.Length == array2.Length);
                if (a) {
@@ -48,7 +48,7 @@ public class MD2Test {
                        msg += " -> Expected " + BitConverter.ToString (array1, 0);
                        msg += " is different than " + BitConverter.ToString (array2, 0);
                }
-               Assertion.Assert (msg, a);
+               Assert.IsTrue (a, msg);
        }
 
        // MD2 ("") = 8350e5a3e24c153df2275c9f80692773
@@ -208,7 +208,7 @@ public class MD2Test {
                for (int i=0; i < input.Length - 1; i++)
                        hash.TransformBlock (input, i, 1, copy, i);
                byte[] output = hash.TransformFinalBlock (input, input.Length - 1, 1);
-               Assertion.AssertEquals (testName + ".e.1", input [input.Length - 1], output [0]);
+               Assert.AreEqual (input [input.Length - 1], output [0], testName + ".e.1");
                AssertEquals (testName + ".e.2", result, hash.Hash);
                // required or next operation will still return old hash
                hash.Initialize ();
@@ -218,9 +218,9 @@ public class MD2Test {
        public virtual void StaticInfo () 
        {
                string className = hash.ToString ();
-               Assertion.AssertEquals (className + ".HashSize", 128, hash.HashSize);
-               Assertion.AssertEquals (className + ".InputBlockSize", 1, hash.InputBlockSize);
-               Assertion.AssertEquals (className + ".OutputBlockSize", 1, hash.OutputBlockSize);
+               Assert.AreEqual (128, hash.HashSize, className + ".HashSize",);
+               Assert.AreEqual (1, hash.InputBlockSize, className + ".InputBlockSize");
+               Assert.AreEqual (1, hash.OutputBlockSize, className + ".OutputBlockSize");
        }
 }
 
index 308b689b91cce34677cf481c6b557b78c4b823a1..111035eb5acebc0027d66b8a0f145ef094b79f1c 100644 (file)
@@ -31,9 +31,9 @@ public class MD4Test {
                if ((array1 == null) && (array2 == null))
                        return;
                if (array1 == null)
-                       Assertion.Fail (msg + " -> First array is NULL");
+                       Assert.Fail (msg + " -> First array is NULL");
                if (array2 == null)
-                       Assertion.Fail (msg + " -> Second array is NULL");
+                       Assert.Fail (msg + " -> Second array is NULL");
 
                bool a = (array1.Length == array2.Length);
                if (a) {
@@ -48,7 +48,7 @@ public class MD4Test {
                        msg += " -> Expected " + BitConverter.ToString (array1, 0);
                        msg += " is different than " + BitConverter.ToString (array2, 0);
                }
-               Assertion.Assert (msg, a);
+               Assert.IsTrue (a, msg);
        }
 
        // MD4 ("") = 31d6cfe0d16ae931b73c59d7e0c089c0
@@ -208,7 +208,7 @@ public class MD4Test {
                for (int i=0; i < input.Length - 1; i++)
                        hash.TransformBlock (input, i, 1, copy, i);
                byte[] output = hash.TransformFinalBlock (input, input.Length - 1, 1);
-               Assertion.AssertEquals (testName + ".e.1", input [input.Length - 1], output [0]);
+               Assert.AreEqual (input [input.Length - 1], output [0], testName + ".e.1");
                AssertEquals (testName + ".e.2", result, hash.Hash);
                // required or next operation will still return old hash
                hash.Initialize ();
@@ -218,9 +218,9 @@ public class MD4Test {
        public virtual void StaticInfo () 
        {
                string className = hash.ToString ();
-               Assertion.AssertEquals (className + ".HashSize", 128, hash.HashSize);
-               Assertion.AssertEquals (className + ".InputBlockSize", 1, hash.InputBlockSize);
-               Assertion.AssertEquals (className + ".OutputBlockSize", 1, hash.OutputBlockSize);
+               Assert.AreEqual (128, hash.HashSize, className + ".HashSize");
+               Assert.AreEqual (1, hash.InputBlockSize, className + ".InputBlockSize");
+               Assert.AreEqual (1, hash.OutputBlockSize, className + ".OutputBlockSize");
        }
 }
 
index 1eb7078938063058c27009e421bf3d59ca4c88fc..a5796e910d77de3be4ff2c9063186e803cf79a37 100644 (file)
@@ -33,9 +33,9 @@ public class MD5Test {
                if ((array1 == null) && (array2 == null))
                        return;
                if (array1 == null)
-                       Assertion.Fail (msg + " -> First array is NULL");
+                       Assert.Fail (msg + " -> First array is NULL");
                if (array2 == null)
-                       Assertion.Fail (msg + " -> Second array is NULL");
+                       Assert.Fail (msg + " -> Second array is NULL");
 
                bool a = (array1.Length == array2.Length);
                if (a) {
@@ -50,7 +50,7 @@ public class MD5Test {
                        msg += " -> Expected " + BitConverter.ToString (array1, 0);
                        msg += " is different than " + BitConverter.ToString (array2, 0);
                }
-               Assertion.Assert (msg, a);
+               Assert.IsTrue (a, msg);
        }
 
        // MD5 ("") = d41d8cd98f00b204e9800998ecf8427e
@@ -210,7 +210,7 @@ public class MD5Test {
                for (int i=0; i < input.Length - 1; i++)
                        hash.TransformBlock (input, i, 1, copy, i);
                byte[] output = hash.TransformFinalBlock (input, input.Length - 1, 1);
-               Assertion.AssertEquals (testName + ".e.1", input [input.Length - 1], output [0]);
+               Assert.AreEqual (input [input.Length - 1], output [0], testName + ".e.1");
                AssertEquals (testName + ".e.2", result, hash.Hash);
                // required or next operation will still return old hash
                hash.Initialize ();
@@ -220,9 +220,9 @@ public class MD5Test {
        public virtual void StaticInfo () 
        {
                string className = hash.ToString ();
-               Assertion.AssertEquals (className + ".HashSize", 128, hash.HashSize);
-               Assertion.AssertEquals (className + ".InputBlockSize", 1, hash.InputBlockSize);
-               Assertion.AssertEquals (className + ".OutputBlockSize", 1, hash.OutputBlockSize);
+               Assert.AreEqual (128, hash.HashSize, className + ".HashSize");
+               Assert.AreEqual (1, hash.InputBlockSize, className + ".InputBlockSize");
+               Assert.AreEqual (1, hash.OutputBlockSize, className + ".OutputBlockSize");
        }
 }
 
index 0ef2206f50bf676319b97dce97070cc25231072c..358beca8d065370879c08a4621d6a37d432d83cb 100644 (file)
@@ -33,9 +33,9 @@ public class SHA1Test {
                if ((array1 == null) && (array2 == null))
                        return;
                if (array1 == null)
-                       Assertion.Fail (msg + " -> First array is NULL");
+                       Assert.Fail (msg + " -> First array is NULL");
                if (array2 == null)
-                       Assertion.Fail (msg + " -> Second array is NULL");
+                       Assert.Fail (msg + " -> Second array is NULL");
 
                bool a = (array1.Length == array2.Length);
                if (a) {
@@ -48,7 +48,7 @@ public class SHA1Test {
                }
                msg += " -> Expected " + BitConverter.ToString (array1, 0);
                msg += " is different than " + BitConverter.ToString (array2, 0);
-               Assertion.Assert (msg, a);
+               Assert.IsTrue (a, msg);
        }
 
        [SetUp]
@@ -63,12 +63,12 @@ public class SHA1Test {
        {
                // test all values static for SHA1
                string className = hash.ToString ();
-               Assertion.AssertEquals (className + ".HashSize", 160, hash.HashSize);
-               Assertion.AssertEquals (className + ".InputBlockSize", 1, hash.InputBlockSize);
-               Assertion.AssertEquals (className + ".OutputBlockSize", 1, hash.OutputBlockSize);
-               Assertion.AssertEquals (className + ".CanReuseTransform", true, hash.CanReuseTransform);
-               Assertion.AssertEquals (className + ".CanTransformMultipleBlocks", true, hash.CanTransformMultipleBlocks);
-               Assertion.AssertEquals (className + ".ToString()", "Mono.Security.Cryptography.SHA1CryptoServiceProvider", className);
+               Assert.AreEqual (className + ".HashSize", 160, hash.HashSize);
+               Assert.AreEqual (className + ".InputBlockSize", 1, hash.InputBlockSize);
+               Assert.AreEqual (className + ".OutputBlockSize", 1, hash.OutputBlockSize);
+               Assert.AreEqual (className + ".CanReuseTransform", true, hash.CanReuseTransform);
+               Assert.AreEqual (className + ".CanTransformMultipleBlocks", true, hash.CanTransformMultipleBlocks);
+               Assert.AreEqual (className + ".ToString()", "Mono.Security.Cryptography.SHA1CryptoServiceProvider", className);
        }
 
        // First test, we hash the string "abc"
index 989adb7697a272b8baefa1a2b6dbd417aa6234a6..56cec328adbcb1f52a4e31f7124d1d8e83721188 100644 (file)
@@ -22,7 +22,7 @@ namespace MonoTests.Mono.Math {
 
                protected void Expect (BigInteger actual, BigInteger expected) 
                {
-                       Assertion.AssertEquals (Name, expected, actual);
+                       Assert.AreEqual (expected, actual, Name);
                }
        }
 }
index 4cf969f69d05d48bf6ba8c61e293f7811ffe5f23..2abf162a89c6869d89d07d93f78c51ee1135ca20 100644 (file)
@@ -81,12 +81,12 @@ namespace MonoTests.Mono.Math {
 
                private void ExpectComposite (BigInteger bi)
                {
-                       Assertion.AssertEquals (false, bi.IsProbablePrime ());
+                       Assert.AreEqual (false, bi.IsProbablePrime ());
                }
 
                private void ExpectPrime (BigInteger bi)
                {
-                       Assertion.AssertEquals (true, bi.IsProbablePrime ());
+                       Assert.AreEqual (true, bi.IsProbablePrime ());
                }
        }
 
@@ -195,7 +195,7 @@ namespace MonoTests.Mono.Math {
        // Adapted from http://lists.ximian.com/archives/public/mono-devel-list/2003-November/003026.html
        // Note: these primes are taken from RFC 2412 [http://www.faqs.org/rfcs/rfc2412.html]
        [TestFixture]
-       public class Rfc2412WellTestedPrimes : Assertion {
+       public class Rfc2412WellTestedPrimes {
 
                // E.1. Well-Known Group 1:  A 768 bit prime
                [Test]
@@ -203,8 +203,8 @@ namespace MonoTests.Mono.Math {
                {
                        string prime = "1552518092300708935130918131258481755631334049434514313202351194902966239949102107258669453876591642442910007680288864229150803718918046342632727613031282983744380820890196288509170691316593175367469551763119843371637221007210577919";
                        BigInteger bi = BigInteger.Parse (prime);
-                       Assert ("isProbablePrime-768", bi.IsProbablePrime ());
-                       AssertEquals ("ToString()", prime, bi.ToString ());
+                       Assert.IsTrue (bi.IsProbablePrime (), "isProbablePrime-768");
+                       Assert.AreEqual (prime, bi.ToString (), "ToString()");
                }
 
                // E.2. Well-Known Group 2:  A 1024 bit prime
@@ -213,8 +213,8 @@ namespace MonoTests.Mono.Math {
                {
                        string prime = "179769313486231590770839156793787453197860296048756011706444423684197180216158519368947833795864925541502180565485980503646440548199239100050792877003355816639229553136239076508735759914822574862575007425302077447712589550957937778424442426617334727629299387668709205606050270810842907692932019128194467627007";
                        BigInteger bi = BigInteger.Parse (prime);
-                       Assert ("isProbablePrime-1024", bi.IsProbablePrime ());
-                       AssertEquals ("ToString()", prime, bi.ToString ());
+                       Assert.IsTrue (bi.IsProbablePrime (), "isProbablePrime-1024");
+                       Assert.AreEqual (prime, bi.ToString (), "ToString()");
                }
 
                // Note: E.3 and E.4 are for Elliptic Curve Groups
@@ -225,8 +225,8 @@ namespace MonoTests.Mono.Math {
                {
                        string prime = "2410312426921032588552076022197566074856950548502459942654116941958108831682612228890093858261341614673227141477904012196503648957050582631942730706805009223062734745341073406696246014589361659774041027169249453200378729434170325843778659198143763193776859869524088940195577346119843545301547043747207749969763750084308926339295559968882457872412993810129130294592999947926365264059284647209730384947211681434464714438488520940127459844288859336526896320919633919";
                        BigInteger bi = BigInteger.Parse (prime);
-                       Assert ("isProbablePrime-1536", bi.IsProbablePrime ());
-                       AssertEquals ("ToString()", prime, bi.ToString ());
+                       Assert.IsTrue (bi.IsProbablePrime (), "isProbablePrime-1536");
+                       Assert.AreEqual (prime, bi.ToString (), "ToString()");
                }
        }
 
index 80434f9983ca1dd3296fe96cfdfbdf61372dc34f..e77246dc9568dfe60c81d27d1009955bd487db17 100644 (file)
@@ -34,7 +34,7 @@ namespace MonoTests.Mono.Math {
                        ContextData ctx = (ContextData)Context;
 
                        
-                       Assertion.AssertEquals (ctx.bits, bits);
+                       Assert.AreEqual (ctx.bits, bits);
                        uint d = ctx.testData;
 
                        for (uint i = (uint)bits - 2; d > 0; i--, d >>= 1)
@@ -65,7 +65,7 @@ namespace MonoTests.Mono.Math {
                                Assert.IsTrue (p.TestBit (1));
                                uint d = ctx.testData;
                                for (uint j = 128 - 2; d > 0; j--, d >>= 1)
-                                       Assertion.AssertEquals ((d&1) == 1, p.TestBit (j));
+                                       Assert.AreEqual ((d&1) == 1, p.TestBit (j));
                        }
                }
        }
index 0f529496e1183d56568e8535ed5a0f53a4aa9629..8696657715e03258c3c79fa620c2e0498af263b0 100644 (file)
@@ -68,7 +68,7 @@ namespace MonoTests.Mono.Security.Authenticode {
 // makecert -n "CN=PVK1" -sv 1.pvk 1.cer
 
 [TestFixture]
-public class PrivateKeyTest : Assertion {
+public class PrivateKeyTest {
 
        // because most crypto stuff works with byte[] buffers
        static public void AssertEquals (string msg, byte[] array1, byte[] array2) 
@@ -76,9 +76,9 @@ public class PrivateKeyTest : Assertion {
                if ((array1 == null) && (array2 == null))
                        return;
                if (array1 == null)
-                       Fail (msg + " -> First array is NULL");
+                       Assert.Fail (msg + " -> First array is NULL");
                if (array2 == null)
-                       Fail (msg + " -> Second array is NULL");
+                       Assert.Fail (msg + " -> Second array is NULL");
 
                bool a = (array1.Length == array2.Length);
                if (a) {
@@ -93,7 +93,7 @@ public class PrivateKeyTest : Assertion {
                        msg += " -> Expected " + BitConverter.ToString (array1, 0);
                        msg += " is different than " + BitConverter.ToString (array2, 0);
                }
-               Assert (msg, a);
+               Assert.IsTrue (a, msg);
        }
 
        string testfile;
@@ -152,10 +152,10 @@ public class PrivateKeyTest : Assertion {
        {
                WriteBuffer (nopwd);
                PrivateKey pvk = PrivateKey.CreateFromFile (testfile);
-               AssertNotNull ("msnopwd.RSA", pvk.RSA);
-               Assert ("msnopwd.Encrypted", !pvk.Encrypted);
-               Assert ("msnopwd.Weak", pvk.Weak);
-               AssertEquals ("msnopwd.KeyType", 2, pvk.KeyType);
+               Assert.IsNotNull (pvk.RSA, "msnopwd.RSA");
+               Assert.IsTrue (!pvk.Encrypted, "msnopwd.Encrypted");
+               Assert.IsTrue (pvk.Weak, "msnopwd.Weak");
+               Assert.AreEqual (2, pvk.KeyType, "msnopwd.KeyType");
        }
 
        // this will convert a PVK file without a password to a PVK file
@@ -168,11 +168,11 @@ public class PrivateKeyTest : Assertion {
                string rsa1 = pvk.RSA.ToXmlString (true);
                pvk.Save (testfile, "password");
                pvk = PrivateKey.CreateFromFile (testfile, "password");
-               AssertNotNull ("topwd.RSA", pvk.RSA);
+               Assert.IsNotNull (pvk.RSA, "topwd.RSA");
                string rsa2 = pvk.RSA.ToXmlString (true);
-               AssertEquals ("topwd.RSA identical", rsa1, rsa2);
-               Assert ("topwd.Encrypted", pvk.Encrypted);
-               Assert ("topwd.Weak", pvk.Weak);
+               Assert.AreEqual (rsa1, rsa2, "topwd.RSA identical");
+               Assert.IsTrue (pvk.Encrypted, "topwd.Encrypted");
+               Assert.IsTrue (pvk.Weak, "topwd.Weak");
        }
 
        // this will convert a PVK file without a password to a PVK file
@@ -186,11 +186,11 @@ public class PrivateKeyTest : Assertion {
                pvk.Weak = false; // we want strong crypto
                pvk.Save (testfile, "password");
                pvk = PrivateKey.CreateFromFile (testfile, "password");
-               AssertNotNull ("topwd.RSA", pvk.RSA);
+               Assert.IsNotNull (pvk.RSA, "topwd.RSA");
                string rsa2 = pvk.RSA.ToXmlString (true);
-               AssertEquals ("topwd.RSA identical", rsa1, rsa2);
-               Assert ("topwd.Encrypted", pvk.Encrypted);
-               Assert ("topwd.Weak", !pvk.Weak);
+               Assert.AreEqual (rsa1, rsa2, "topwd.RSA identical");
+               Assert.IsTrue (pvk.Encrypted, "topwd.Encrypted");
+               Assert.IsTrue (!pvk.Weak, "topwd.Weak");
        }
 
        static byte[] pwd = { 
@@ -229,9 +229,9 @@ public class PrivateKeyTest : Assertion {
        {
                WriteBuffer (pwd);
                PrivateKey pvk = PrivateKey.CreateFromFile (testfile, "password");
-               AssertNotNull ("mspwd.RSA", pvk.RSA);
-               Assert ("mspwd.Encrypted", pvk.Encrypted);
-               Assert ("mspwd.Weak", pvk.Weak);
+               Assert.IsNotNull (pvk.RSA, "mspwd.RSA");
+               Assert.IsTrue (pvk.Encrypted, "mspwd.Encrypted");
+               Assert.IsTrue (pvk.Weak, "mspwd.Weak");
        }
 
        // this will convert a PVK file with a password to a PVK file
@@ -244,11 +244,11 @@ public class PrivateKeyTest : Assertion {
                string rsa1 = pvk.RSA.ToXmlString (true);
                pvk.Save (testfile);
                pvk = PrivateKey.CreateFromFile (testfile);
-               AssertNotNull ("nomorepwd.RSA", pvk.RSA);
+               Assert.IsNotNull (pvk.RSA, "nomorepwd.RSA");
                string rsa2 = pvk.RSA.ToXmlString (true);
-               AssertEquals ("nomorepwd.RSA identical", rsa1, rsa2);
-               Assert ("nomorepwd.Encrypted", !pvk.Encrypted);
-               Assert ("nomorepwd.Weak", pvk.Weak);
+               Assert.AreEqual (rsa1, rsa2, "nomorepwd.RSA identical");
+               Assert.IsTrue (!pvk.Encrypted, "nomorepwd.Encrypted");
+               Assert.IsTrue (pvk.Weak, "nomorepwd.Weak");
        }
        
        [Test]
@@ -261,11 +261,11 @@ public class PrivateKeyTest : Assertion {
                pvk.Save (testfile, "mono");
 
                pvk = PrivateKey.CreateFromFile (testfile, "mono");
-               AssertNotNull ("new.RSA", pvk.RSA);
+               Assert.IsNotNull (pvk.RSA, "new.RSA");
                string rsa2 = pvk.RSA.ToXmlString (true);
-               AssertEquals ("new.RSA identical", rsa1, rsa2);
-               Assert ("new.Encrypted", pvk.Encrypted);
-               Assert ("new.Weak", !pvk.Weak);
+               Assert.AreEqual (rsa1, rsa2, "new.RSA identical");
+               Assert.IsTrue (pvk.Encrypted, "new.Encrypted");
+               Assert.IsTrue (!pvk.Weak, "new.Weak");
        }
 
        [Test]
index 38ecbc3b2358952724e7b843200a136b3b013d91..a527208839abf2a3d9e02bda5c63e177d6fac637 100644 (file)
@@ -15,7 +15,7 @@ using Mono.Security.Cryptography;
 namespace MonoTests.Mono.Security.Cryptography {
 
        [TestFixture]
-       public class CryptoConvertTest : Assertion {
+       public class CryptoConvertTest {
 
                // because most crypto stuff works with byte[] buffers
                static public void AssertEquals (string msg, byte[] array1, byte[] array2) 
@@ -23,9 +23,9 @@ namespace MonoTests.Mono.Security.Cryptography {
                        if ((array1 == null) && (array2 == null))
                                return;
                        if (array1 == null)
-                               Fail (msg + " -> First array is NULL");
+                               Assert.Fail (msg + " -> First array is NULL");
                        if (array2 == null)
-                               Fail (msg + " -> Second array is NULL");
+                               Assert.Fail (msg + " -> Second array is NULL");
                
                        bool a = (array1.Length == array2.Length);
                        if (a) {
@@ -38,7 +38,7 @@ namespace MonoTests.Mono.Security.Cryptography {
                        }
                        msg += " -> Expected " + BitConverter.ToString (array1, 0);
                        msg += " is different than " + BitConverter.ToString (array2, 0);
-                       Assert (msg, a);
+                       Assert.IsTrue (a, msg);
                }
 
                // strongname generated using "sn -k unit.snk"
@@ -163,16 +163,16 @@ namespace MonoTests.Mono.Security.Cryptography {
                {
                        // keypair
                        RSA rsa = CryptoConvert.FromCapiKeyBlob (strongName, 0);
-                       AssertEquals ("KeyPair", strongNameString, rsa.ToXmlString (true));
-                       AssertEquals ("PublicKey-1", strongNamePublicKeyString, rsa.ToXmlString (false));
+                       Assert.AreEqual (strongNameString, rsa.ToXmlString (true), "KeyPair");
+                       Assert.AreEqual (strongNamePublicKeyString, rsa.ToXmlString (false), "PublicKey-1");
 
                        // public key (direct)
                        rsa = CryptoConvert.FromCapiKeyBlob (strongNamePublicKey, 12);
-                       AssertEquals ("PublicKey-2", strongNamePublicKeyString, rsa.ToXmlString (false));
+                       Assert.AreEqual (strongNamePublicKeyString, rsa.ToXmlString (false), "PublicKey-2");
 
                        // public key (indirect - inside header)
                        rsa = CryptoConvert.FromCapiKeyBlob (strongNamePublicKey, 0);
-                       AssertEquals ("PublicKey-3", strongNamePublicKeyString, rsa.ToXmlString (false));
+                       Assert.AreEqual (strongNamePublicKeyString, rsa.ToXmlString (false), "PublicKey-3");
                }
 
                [Test]
@@ -201,7 +201,7 @@ namespace MonoTests.Mono.Security.Cryptography {
                public void FromCapiPrivateKeyBlob () 
                {
                        RSA rsa = CryptoConvert.FromCapiPrivateKeyBlob (strongName, 0);
-                       AssertEquals ("KeyPair", strongNameString, rsa.ToXmlString (true));
+                       Assert.AreEqual (strongNameString, rsa.ToXmlString (true), "KeyPair");
                }
 
                [Test]
@@ -229,7 +229,7 @@ namespace MonoTests.Mono.Security.Cryptography {
                public void FromCapiPublicKeyBlob () 
                {
                        RSA rsa = CryptoConvert.FromCapiPublicKeyBlob (strongNamePublicKey, 12);
-                       AssertEquals ("PublicKey", strongNamePublicKeyString, rsa.ToXmlString (false));
+                       Assert.AreEqual (strongNamePublicKeyString, rsa.ToXmlString (false), "PublicKey");
                }
 
                [Test]
@@ -262,12 +262,12 @@ namespace MonoTests.Mono.Security.Cryptography {
                        AssertEquals ("RSA-KeyPair", strongName, keypair);
 
                        byte[] publicKey = CryptoConvert.ToCapiKeyBlob (rsa, false);
-                       AssertEquals ("RSA-PublicKey", BitConverter.ToString (strongNamePublicKey, 12), BitConverter.ToString (publicKey));
+                       Assert.AreEqual (BitConverter.ToString (strongNamePublicKey, 12), BitConverter.ToString (publicKey), "RSA-PublicKey");
                        
                        AsymmetricAlgorithm dsa = DSA.Create ();
                        dsa.FromXmlString (dsaKeyPairString);
                        AssertEquals ("DSA-KeyPair", dsaPrivBlob, CryptoConvert.ToCapiKeyBlob (dsa, true));
-                       AssertEquals ("DSA-PublicKey", BitConverter.ToString (dsaPubBlob), BitConverter.ToString (CryptoConvert.ToCapiKeyBlob (dsa, false)));
+                       Assert.AreEqual (BitConverter.ToString (dsaPubBlob), BitConverter.ToString (CryptoConvert.ToCapiKeyBlob (dsa, false)), "DSA-PublicKey");
                }
 
                [Test]
@@ -279,7 +279,7 @@ namespace MonoTests.Mono.Security.Cryptography {
                        AssertEquals ("KeyPair", strongName, keypair);
 
                        byte[] publicKey = CryptoConvert.ToCapiKeyBlob (rsa, false);
-                       AssertEquals ("PublicKey", BitConverter.ToString (strongNamePublicKey, 12), BitConverter.ToString (publicKey));
+                       Assert.AreEqual (BitConverter.ToString (strongNamePublicKey, 12), BitConverter.ToString (publicKey), "PublicKey");
                }
 
                [Test]
@@ -323,11 +323,11 @@ namespace MonoTests.Mono.Security.Cryptography {
                        // full keypair
                        rsa.FromXmlString (strongNameString);
                        byte[] publicKey = CryptoConvert.ToCapiPublicKeyBlob (rsa);
-                       AssertEquals ("PublicKey-1", BitConverter.ToString (strongNamePublicKey, 12), BitConverter.ToString (publicKey));
+                       Assert.AreEqual (BitConverter.ToString (strongNamePublicKey, 12), BitConverter.ToString (publicKey), "PublicKey-1");
                        // public key only
                        rsa.FromXmlString (strongNamePublicKeyString);
                        publicKey = CryptoConvert.ToCapiPublicKeyBlob (rsa);
-                       AssertEquals ("PublicKey-2", BitConverter.ToString (strongNamePublicKey, 12), BitConverter.ToString (publicKey));
+                       Assert.AreEqual (BitConverter.ToString (strongNamePublicKey, 12), BitConverter.ToString (publicKey), "PublicKey-2");
                }
 
                /* DSA key tests */
@@ -419,8 +419,8 @@ namespace MonoTests.Mono.Security.Cryptography {
                public void FromCapiKeyBlobDSA ()
                {
                        DSA dsa = CryptoConvert.FromCapiKeyBlobDSA (dsaPrivBlob);
-                       AssertEquals ("KeyPair", dsaKeyPairString, dsa.ToXmlString (true));
-                       AssertEquals ("PublicKey", dsaPubKeyString, dsa.ToXmlString (false));
+                       Assert.AreEqual (dsaKeyPairString, dsa.ToXmlString (true), "KeyPair");
+                       Assert.AreEqual (dsaPubKeyString, dsa.ToXmlString (false), "PublicKey");
                }
 
                [Test]
@@ -449,7 +449,7 @@ namespace MonoTests.Mono.Security.Cryptography {
                public void FromCapiPrivateKeyBlobDSA ()
                {
                        DSA dsa = CryptoConvert.FromCapiPrivateKeyBlobDSA (dsaPrivBlob, 0);
-                       AssertEquals ("KeyPair", dsaKeyPairString, dsa.ToXmlString (true));
+                       Assert.AreEqual (dsaKeyPairString, dsa.ToXmlString (true), "KeyPair");
                }
 
                [Test]
@@ -478,7 +478,7 @@ namespace MonoTests.Mono.Security.Cryptography {
                public void FromCapiPublicKeyBlobDSA ()
                {
                        DSA dsa = CryptoConvert.FromCapiPublicKeyBlobDSA (dsaPubBlob, 0);
-                       AssertEquals ("PublicKey", dsaPubKeyString, dsa.ToXmlString (false));
+                       Assert.AreEqual (dsaPubKeyString, dsa.ToXmlString (false), "PublicKey");
                }
 
                [Test]
@@ -512,7 +512,7 @@ namespace MonoTests.Mono.Security.Cryptography {
                        AssertEquals ("KeyPair", dsaPrivBlob, keypair);
 
                        byte[] pubkey = CryptoConvert.ToCapiKeyBlob (dsa, false);
-                       AssertEquals ("PublicKey", BitConverter.ToString (dsaPubBlob), BitConverter.ToString (pubkey));
+                       Assert.AreEqual (BitConverter.ToString (dsaPubBlob), BitConverter.ToString (pubkey), "PublicKey");
                }
 
                [Test]
@@ -548,20 +548,20 @@ namespace MonoTests.Mono.Security.Cryptography {
                        // full keypair
                        dsa.FromXmlString (dsaKeyPairString);
                        byte[] pubkey = CryptoConvert.ToCapiPublicKeyBlob (dsa);
-                       AssertEquals ("PublicKey-1", BitConverter.ToString (dsaPubBlob), BitConverter.ToString (pubkey));
+                       Assert.AreEqual (BitConverter.ToString (dsaPubBlob), BitConverter.ToString (pubkey), "PublicKey-1");
 
                        // public key only
                        dsa.FromXmlString (dsaPubKeyString);
                        pubkey = CryptoConvert.ToCapiPublicKeyBlob (dsa);
-                       AssertEquals ("PublicKey-2", BitConverter.ToString (dsaPubBlob), BitConverter.ToString (pubkey));
+                       Assert.AreEqual (BitConverter.ToString (dsaPubBlob), BitConverter.ToString (pubkey), "PublicKey-2");
                }
 
                [Test]
                public void FromHex () 
                {
-                       AssertNull ("FromHex(null)", CryptoConvert.FromHex (null));
+                       Assert.IsNull (CryptoConvert.FromHex (null), "FromHex(null)");
                        string result = BitConverter.ToString (CryptoConvert.FromHex ("0123456789aBcDeF"));
-                       AssertEquals ("0123456789abcdef", "01-23-45-67-89-AB-CD-EF", result);
+                       Assert.AreEqual ("01-23-45-67-89-AB-CD-EF", result, "0123456789abcdef");
                }
 
                [Test]
@@ -581,9 +581,9 @@ namespace MonoTests.Mono.Security.Cryptography {
                [Test]
                public void ToHex () 
                {
-                       AssertNull ("FromHex(null)", CryptoConvert.FromHex (null));
+                       Assert.IsNull (CryptoConvert.FromHex (null), "FromHex(null)");
                        byte[] data = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
-                       AssertEquals ("0123456789abcdef", "0123456789ABCDEF", CryptoConvert.ToHex (data));
+                       Assert.AreEqual ("0123456789ABCDEF", CryptoConvert.ToHex (data), "0123456789abcdef");
                }
                
                [Test]
@@ -595,8 +595,8 @@ namespace MonoTests.Mono.Security.Cryptography {
                        RSA rsa = CryptoConvert.FromCapiKeyBlob (strongNameNUnit, 0);
                        // note the bad D parameters !!!
                        // this only works because CRT is being used
-                       AssertEquals ("KeyPair", "<RSAKeyValue><Modulus>rB8h0TaMs8fWA+5WMdcjOjejCZwhYwuFHUZPS0cC9TOG6FJtvlHPpZLQAg0xfLr2SivPRol1Xw9SqhuaYQNJA7sAaOb8Rvgmx93XbmcNotY9ob4TGaesk+M8VsdexsIJ3WlyLbmRlf0EjT52nboyauEL3UC85zkMjW1LNb8LSs8=</Modulus><Exponent>AQAB</Exponent><P>2d4pGForvc792ztFxhNuzxIihDnXp+qK9F8t/NduhRBdu+JXK4d8a9EGwzpMxLUPlHjCZfXRraZiSQszkH+nzQ==</P><Q>yj9BeGmOrucOUCNZYTtXI0ykzz+1g+cVMSxi+6xzoLEOqmdE4gjcWaxak4MF1+pIR6UycnNa/jg1LBl7MKxpCw==</Q><DP>cMkAjznG4Sjx4/dIRKU0vP/PXJIxIR1bN+y5+uVvsnTpgWVH6SHneE0qahCZQ0/UM/Fb+bqLBJFY2iVxWUGslQ==</DP><DQ>gz6TXPGbLzMv3Z9i5C8e+ABHv1pHj6ZI4VU9kraxfmkH7FsBn3FClUq8qJdRFnGpoBy65Pyo4upUzx5mDAsGSw==</DQ><InverseQ>x+UShV+0d9cicoiB9fkSLqpLDyF4dYzVu0uqX0eCcoGJpk19jtSaMI3Eo8VN6MJAW1zrRy+MA1Fqb9qeThLqZQ==</InverseQ><D>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</D></RSAKeyValue>", rsa.ToXmlString (true));
-                       AssertEquals ("PublicKey", "<RSAKeyValue><Modulus>rB8h0TaMs8fWA+5WMdcjOjejCZwhYwuFHUZPS0cC9TOG6FJtvlHPpZLQAg0xfLr2SivPRol1Xw9SqhuaYQNJA7sAaOb8Rvgmx93XbmcNotY9ob4TGaesk+M8VsdexsIJ3WlyLbmRlf0EjT52nboyauEL3UC85zkMjW1LNb8LSs8=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>", rsa.ToXmlString (false));
+                       Assert.AreEqual ("<RSAKeyValue><Modulus>rB8h0TaMs8fWA+5WMdcjOjejCZwhYwuFHUZPS0cC9TOG6FJtvlHPpZLQAg0xfLr2SivPRol1Xw9SqhuaYQNJA7sAaOb8Rvgmx93XbmcNotY9ob4TGaesk+M8VsdexsIJ3WlyLbmRlf0EjT52nboyauEL3UC85zkMjW1LNb8LSs8=</Modulus><Exponent>AQAB</Exponent><P>2d4pGForvc792ztFxhNuzxIihDnXp+qK9F8t/NduhRBdu+JXK4d8a9EGwzpMxLUPlHjCZfXRraZiSQszkH+nzQ==</P><Q>yj9BeGmOrucOUCNZYTtXI0ykzz+1g+cVMSxi+6xzoLEOqmdE4gjcWaxak4MF1+pIR6UycnNa/jg1LBl7MKxpCw==</Q><DP>cMkAjznG4Sjx4/dIRKU0vP/PXJIxIR1bN+y5+uVvsnTpgWVH6SHneE0qahCZQ0/UM/Fb+bqLBJFY2iVxWUGslQ==</DP><DQ>gz6TXPGbLzMv3Z9i5C8e+ABHv1pHj6ZI4VU9kraxfmkH7FsBn3FClUq8qJdRFnGpoBy65Pyo4upUzx5mDAsGSw==</DQ><InverseQ>x+UShV+0d9cicoiB9fkSLqpLDyF4dYzVu0uqX0eCcoGJpk19jtSaMI3Eo8VN6MJAW1zrRy+MA1Fqb9qeThLqZQ==</InverseQ><D>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</D></RSAKeyValue>", rsa.ToXmlString (true), "KeyPair");
+                       Assert.AreEqual ("<RSAKeyValue><Modulus>rB8h0TaMs8fWA+5WMdcjOjejCZwhYwuFHUZPS0cC9TOG6FJtvlHPpZLQAg0xfLr2SivPRol1Xw9SqhuaYQNJA7sAaOb8Rvgmx93XbmcNotY9ob4TGaesk+M8VsdexsIJ3WlyLbmRlf0EjT52nboyauEL3UC85zkMjW1LNb8LSs8=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>", rsa.ToXmlString (false), "PublicKey");
                }
        }
 }
index 2a38eb819dc21dca2764a0f76d80c7ff007a84a0..a0d3caf1f7d2aa4f6b1c4f866b36fe06a6200ca0 100644 (file)
@@ -24,7 +24,7 @@ namespace MonoTests.Mono.Security.Cryptography {
        //      http://www.ietf.org/rfc/rfc2631.txt
 
        [TestFixture]
-       public class DiffieHellmanManagedTest : Assertion {
+       public class DiffieHellmanManagedTest {
 
                // because most crypto stuff works with byte[] buffers
                static public void AssertEquals (string msg, byte[] array1, byte[] array2) 
@@ -32,9 +32,9 @@ namespace MonoTests.Mono.Security.Cryptography {
                        if ((array1 == null) && (array2 == null))
                                return;
                        if (array1 == null)
-                               Assertion.Fail (msg + " -> First array is NULL");
+                               Assert.Fail (msg + " -> First array is NULL");
                        if (array2 == null)
-                               Assertion.Fail (msg + " -> Second array is NULL");
+                               Assert.Fail (msg + " -> Second array is NULL");
 
                        bool a = (array1.Length == array2.Length);
                        if (a) {
@@ -49,7 +49,7 @@ namespace MonoTests.Mono.Security.Cryptography {
                                msg += " -> Expected " + BitConverter.ToString (array1, 0);
                                msg += " is different than " + BitConverter.ToString (array2, 0);
                        }
-                       Assertion.Assert (msg, a);
+                       Assert.IsTrue (a, msg);
                }
 
                [Test]
@@ -70,7 +70,7 @@ namespace MonoTests.Mono.Security.Cryptography {
                        // let the second DH instance compute the shared secret using the first DH public key
                        byte[] dh2k = dh2.DecryptKeyExchange (ke1);
                        // both shared secrets are the same
-                       AssertEquals ("Shared Secret", dh1k, dh2k);
+                       Assert.AreEqual (dh1k, dh2k, "Shared Secret");
                }
 
                // TODO: More is needed !
index 42f7584e1c9683712c3a668fd4aabad1dfc6041c..8ec9779b2db08e6ed676fa9033f4b8775b2a9cbe 100644 (file)
@@ -19,7 +19,7 @@ using NUnit.Framework;
 namespace MonoTests.Mono.Security.Cryptography {
 
        [TestFixture]
-       public class PKCS8Test : Assertion {
+       public class PKCS8Test {
 
                static public byte[] pkcs8_der = { 0x30, 0x82, 0x02, 0xB2, 0x30, 0x1C, 0x06, 0x0A, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x0C, 0x01, 0x03, 0x30, 0x0E, 0x04, 0x08, 0x86, 0x2A, 0xA9, 0x71, 0x6D, 0xA4, 0xB8, 0x2D, 0x02, 0x02, 0x07, 0xD0, 0x04, 0x82, 0x02, 0x90, 0x90, 0x14, 0xB5, 0xF0, 0xB6, 0x86, 0x56, 0xCB, 0xFA, 0x63, 0xAD, 0x9F, 0x5A, 0x59, 0x6C, 0xAD, 0x00, 0x3C, 0x37, 0x8A, 0xC3, 0x88, 0x58, 0x8B, 0xD7, 0x48, 0x53, 0x7A, 0xC8, 0x5B, 0x0D, 0x98, 0xDD, 0x8B, 0xB3, 0xEC, 0x4C, 0xAC, 0x61, 0x18, 0xE3, 0x5E, 0x47, 0xAD, 0xC7, 0x92, 0xBC, 0xD3, 0x00, 0x07, 0xFF, 0x1A, 0x68, 0x74, 0x45, 0x8E, 0xD8, 0x7C, 0x9F, 0x18, 0x7B, 0xD7, 0xC8, 
                        0x47, 0xBA, 0x6B, 0x19, 0xF2, 0xBF, 0x7E, 0x51, 0x0B, 0x4B, 0x43, 0xE8, 0xB9, 0x56, 0x7E, 0xD0, 0x74, 0xC7, 0xDE, 0x76, 0xDB, 0xFF, 0x5C, 0x6B, 0x53, 0xBE, 0x31, 0x06, 0xAE, 0x6C, 0x8F, 0xDC, 0x49, 0x04, 0x71, 0x74, 0xEE, 0xB8, 0x06, 0xCB, 0xAD, 0x86, 0xB4, 0x4E, 0xB9, 0x46, 0xA1, 0x03, 0x5E, 0x0E, 0xA7, 0xC7, 0x37, 0x6B, 0xB0, 0x8D, 0x2D, 0x81, 0x1F, 0xE3, 0xC2, 0x05, 0xDE, 0xEF, 0x51, 0x07, 0x70, 0x6E, 0x35, 0x9A, 0xAD, 0x19, 0x5E, 0xAF, 0xEB, 0x7F, 0xEF, 0xE4, 0xAB, 0x07, 0xF3, 0xF6, 0xEA, 0xFA, 0x0E, 0x83, 0x65, 0x06, 0x3C, 0xF3, 0xBD, 0x96, 0x08, 0x14, 0xC5, 0x34, 0x26, 0xED, 0xC0, 0x10, 
@@ -32,13 +32,13 @@ namespace MonoTests.Mono.Security.Cryptography {
                [Test]
                public void EncryptedPrivateKey_Farscape () 
                {
-                       AssertEquals ("PKCS8.GetType", PKCS8.KeyInfo.EncryptedPrivateKey, PKCS8.GetType (pkcs8_der));
+                       Assert.AreEqual (PKCS8.KeyInfo.EncryptedPrivateKey, PKCS8.GetType (pkcs8_der), "PKCS8.GetType");
                        PKCS8.EncryptedPrivateKeyInfo p8 = new PKCS8.EncryptedPrivateKeyInfo (pkcs8_der);
-                       AssertEquals ("Algorithm", "1.2.840.113549.1.12.1.3", p8.Algorithm);
-                       AssertEquals ("EncryptedData", "90-14-B5-F0-B6-86-56-CB-FA-63-AD-9F-5A-59-6C-AD-00-3C-37-8A-C3-88-58-8B-D7-48-53-7A-C8-5B-0D-98-DD-8B-B3-EC-4C-AC-61-18-E3-5E-47-AD-C7-92-BC-D3-00-07-FF-1A-68-74-45-8E-D8-7C-9F-18-7B-D7-C8-47-BA-6B-19-F2-BF-7E-51-0B-4B-43-E8-B9-56-7E-D0-74-C7-DE-76-DB-FF-5C-6B-53-BE-31-06-AE-6C-8F-DC-49-04-71-74-EE-B8-06-CB-AD-86-B4-4E-B9-46-A1-03-5E-0E-A7-C7-37-6B-B0-8D-2D-81-1F-E3-C2-05-DE-EF-51-07-70-6E-35-9A-AD-19-5E-AF-EB-7F-EF-E4-AB-07-F3-F6-EA-FA-0E-83-65-06-3C-F3-BD-96-08-14-C5-34-26-ED-C0-10-CC-AE-2D-8F-BE-ED-98-0D-88-1B-1E-C7-37-F0-FC-DB-3C-E3-1B-66-52-45-6E-05-A6-D9-12-23-05-5F-E3-9F-7D-21-9B-2E-3E-9E-3C-EE-D1-9B-55-DE-57-60-A5-24-2D-C7-94-EC-FC-B1-6A-65-BD-85-02-5C-58-AA-5A-6A-F3-AC-6B-DD-0E-63-B2-4B-5B-67-3D-C3-BF-E4-C8-EF-3F-89-5A-CD-6D-EF-05-22-2B-72-FF-80-7A-DD-F1-59-A7-6F-00-B1-BD-4D-88-D6-E4-8A-DD-A9-FC-D9-01-0A-65-8E-52-F9-7E-20-72-67-0D-5B-EE-67-5B-46-4A-15-A2-6F-15-2B-5B-9A-93-12-4F-F4-AD-49-D0-11-F1-7E-40-DE-32-96-2E-B3-E8-71-60-27-6E-A2-71-83-C7-FE-0E-8B-31-06-64-E1-19-02-B9-44-25-0C-94-64-7E-5F-89-4D-7E-99-0B-91-B8-22-A5-33-92-D3-49-07-1D-C6-25-4A-D7-6D-E2-94-3F-FA-10-72-59-62-F5-C6-D4-3A-EE-8F-BC-9C-BC-FC-C7-37-BF-7C-A0-67-B0-FF-0F-29-A0-A2-71-6B-21-00-F4-54-D9-3D-1B-CE-F4-FE-6F-F5-21-CB-47-58-17-F6-45-2F-A0-3B-8B-D9-B8-8A-33-3F-16-E0-C7-8A-B8-11-2F-A8-7E-7D-A7-7B-65-27-89-3C-67-4D-D5-70-28-76-60-96-68-BF-FB-CD-49-E0-8A-7C-6F-76-06-48-6D-63-67-8A-47-82-5E-7F-0E-AC-46-B6-BC-0A-6D-E2-1A-3A-20-A5-C7-81-71-6E-2B-16-97-D4-FA-C0-DD-72-5B-9F-A3-43-F4-85-B1-C6-A8-E0-62-81-5D-A5-07-29-6A-6A-2D-E1-1D-BE-12-6D-42-58-6F-4E-30-3D-BF-32-11-38-BC-36-76-60-FC-57-2F-D3-9E-C4-1A-92-EA-DE-85-FD-E7-AA-30-A6-97-2C-36-3B-3B-0E-92-52-FF-42-D7-62-6C-C1-3A-E7-1B-4E-13-8C-95-B3-4B-A7-9E-42-75-A8-CA-63-76-C4-45-74-96-43-D8-86-82-BE-37-FF-9B-EB-B7-18-A1-2F-E3-6C-08-E8-11-96-8C-5E-9E-2B-E7-DB-7D-54-E1-DB-1E-D3-8F-B5-19-4B-B2-16-DB-CF-EC-88-0B-6C-3C-E4-F2-C4-FF-4D-3E-53-52-3A-81-0B-6E-AC-95-EA-5A-6E-4D-83-23-82-C9-90-02-74-10-2A-6C-FB-97-4F-5F-70-8E-F0-B9"
-                               BitConverter.ToString (p8.EncryptedData));
-                       AssertEquals ("Salt", "86-2A-A9-71-6D-A4-B8-2D", BitConverter.ToString (p8.Salt));
-                       AssertEquals ("IterationCount", 2000, p8.IterationCount);
+                       Assert.AreEqual ("1.2.840.113549.1.12.1.3", p8.Algorithm, "Algorithm");
+                       Assert.AreEqual ("90-14-B5-F0-B6-86-56-CB-FA-63-AD-9F-5A-59-6C-AD-00-3C-37-8A-C3-88-58-8B-D7-48-53-7A-C8-5B-0D-98-DD-8B-B3-EC-4C-AC-61-18-E3-5E-47-AD-C7-92-BC-D3-00-07-FF-1A-68-74-45-8E-D8-7C-9F-18-7B-D7-C8-47-BA-6B-19-F2-BF-7E-51-0B-4B-43-E8-B9-56-7E-D0-74-C7-DE-76-DB-FF-5C-6B-53-BE-31-06-AE-6C-8F-DC-49-04-71-74-EE-B8-06-CB-AD-86-B4-4E-B9-46-A1-03-5E-0E-A7-C7-37-6B-B0-8D-2D-81-1F-E3-C2-05-DE-EF-51-07-70-6E-35-9A-AD-19-5E-AF-EB-7F-EF-E4-AB-07-F3-F6-EA-FA-0E-83-65-06-3C-F3-BD-96-08-14-C5-34-26-ED-C0-10-CC-AE-2D-8F-BE-ED-98-0D-88-1B-1E-C7-37-F0-FC-DB-3C-E3-1B-66-52-45-6E-05-A6-D9-12-23-05-5F-E3-9F-7D-21-9B-2E-3E-9E-3C-EE-D1-9B-55-DE-57-60-A5-24-2D-C7-94-EC-FC-B1-6A-65-BD-85-02-5C-58-AA-5A-6A-F3-AC-6B-DD-0E-63-B2-4B-5B-67-3D-C3-BF-E4-C8-EF-3F-89-5A-CD-6D-EF-05-22-2B-72-FF-80-7A-DD-F1-59-A7-6F-00-B1-BD-4D-88-D6-E4-8A-DD-A9-FC-D9-01-0A-65-8E-52-F9-7E-20-72-67-0D-5B-EE-67-5B-46-4A-15-A2-6F-15-2B-5B-9A-93-12-4F-F4-AD-49-D0-11-F1-7E-40-DE-32-96-2E-B3-E8-71-60-27-6E-A2-71-83-C7-FE-0E-8B-31-06-64-E1-19-02-B9-44-25-0C-94-64-7E-5F-89-4D-7E-99-0B-91-B8-22-A5-33-92-D3-49-07-1D-C6-25-4A-D7-6D-E2-94-3F-FA-10-72-59-62-F5-C6-D4-3A-EE-8F-BC-9C-BC-FC-C7-37-BF-7C-A0-67-B0-FF-0F-29-A0-A2-71-6B-21-00-F4-54-D9-3D-1B-CE-F4-FE-6F-F5-21-CB-47-58-17-F6-45-2F-A0-3B-8B-D9-B8-8A-33-3F-16-E0-C7-8A-B8-11-2F-A8-7E-7D-A7-7B-65-27-89-3C-67-4D-D5-70-28-76-60-96-68-BF-FB-CD-49-E0-8A-7C-6F-76-06-48-6D-63-67-8A-47-82-5E-7F-0E-AC-46-B6-BC-0A-6D-E2-1A-3A-20-A5-C7-81-71-6E-2B-16-97-D4-FA-C0-DD-72-5B-9F-A3-43-F4-85-B1-C6-A8-E0-62-81-5D-A5-07-29-6A-6A-2D-E1-1D-BE-12-6D-42-58-6F-4E-30-3D-BF-32-11-38-BC-36-76-60-FC-57-2F-D3-9E-C4-1A-92-EA-DE-85-FD-E7-AA-30-A6-97-2C-36-3B-3B-0E-92-52-FF-42-D7-62-6C-C1-3A-E7-1B-4E-13-8C-95-B3-4B-A7-9E-42-75-A8-CA-63-76-C4-45-74-96-43-D8-86-82-BE-37-FF-9B-EB-B7-18-A1-2F-E3-6C-08-E8-11-96-8C-5E-9E-2B-E7-DB-7D-54-E1-DB-1E-D3-8F-B5-19-4B-B2-16-DB-CF-EC-88-0B-6C-3C-E4-F2-C4-FF-4D-3E-53-52-3A-81-0B-6E-AC-95-EA-5A-6E-4D-83-23-82-C9-90-02-74-10-2A-6C-FB-97-4F-5F-70-8E-F0-B9", BitConverter.ToString (p8.EncryptedData)
+                               "EncryptedData");
+                       Assert.AreEqual ("86-2A-A9-71-6D-A4-B8-2D", BitConverter.ToString (p8.Salt), "Salt");
+                       Assert.AreEqual (2000, p8.IterationCount, "IterationCount");
                }
 
                static public byte[] End_Certificate_CP_01_01_crtx = { 0x30, 0x82, 0x02, 0x78, 0x02, 0x01, 0x00, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x82, 0x02, 0x62, 0x30, 0x82, 0x02, 0x5E, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xC6, 0x34, 0xEC, 0x6F, 0x0C, 0xE0, 0x59, 0x0E, 0xBC, 0x5F, 0xBA, 0x2E, 0x93, 0xBB, 0x04, 0xA7, 0x03, 0xB9, 0x70, 0x8A, 0xB9, 0xD7, 0xE5, 0xD7, 0xE6, 0xCA, 0x4A, 0x8C, 0x23, 0xD8, 0x60, 0xB3, 0x6B, 0xCB, 0x88, 0x88, 0xC7, 0xD8, 0x48, 0x7E, 0x64, 0xF9, 0xF6, 0x1B, 0xE3, 0x79, 0x46, 0x41, 0xE4, 0x61, 0xF7, 0x25, 0x47, 0x71, 0xF3, 0x50, 0x94, 0x4E, 0xF2, 0x7C, 0x6A, 0x37, 0xB6, 0x0C, 
@@ -68,25 +68,25 @@ namespace MonoTests.Mono.Security.Cryptography {
                [Test]
                public void PrivateKeyInfo_End_Certificate_CP_01_01 () 
                {
-                       AssertEquals ("PKCS8.GetType", PKCS8.KeyInfo.PrivateKey, PKCS8.GetType (End_Certificate_CP_01_01_crtx));
+                       Assert.AreEqual (PKCS8.KeyInfo.PrivateKey, PKCS8.GetType (End_Certificate_CP_01_01_crtx), "PKCS8.GetType");
                        PKCS8.PrivateKeyInfo p8 = new PKCS8.PrivateKeyInfo (End_Certificate_CP_01_01_crtx);
-                       AssertEquals ("Algorithm", "1.2.840.113549.1.1.1", p8.Algorithm);
-                       AssertEquals ("Attributes", 0, p8.Attributes.Count);
-                       AssertEquals ("PrivateKey", BitConverter.ToString (End_Certificate_CP_01_01_pki), BitConverter.ToString (p8.PrivateKey));
-                       AssertEquals ("Version", 0, p8.Version);
+                       Assert.AreEqual ("1.2.840.113549.1.1.1", p8.Algorithm, "Algorithm");
+                       Assert.AreEqual (0, p8.Attributes.Count, "Attributes");
+                       Assert.AreEqual (BitConverter.ToString (End_Certificate_CP_01_01_pki), BitConverter.ToString (p8.PrivateKey), "PrivateKey");
+                       Assert.AreEqual (0, p8.Version, "Version");
                }
 
                [Test]
                public void PrivateKeyInfo_End_Certificate_CP_01_02 () 
                {
                        PKCS8.PrivateKeyInfo p8 = new PKCS8.PrivateKeyInfo (End_Certificate_CP_01_02_crtx);
-                       AssertEquals ("Algorithm", "1.2.840.113549.1.1.1", p8.Algorithm);
-                       AssertEquals ("Attributes", 0, p8.Attributes.Count);
-                       AssertEquals ("PrivateKey", "30-82-02-5B-02-01-00-02-81-81-00-D6-39-9E-21-93-E2-BA-35-7F-E5-F8-E8-87-0B-8A-5F-28-25-85-B7-E5-CC-DA-7F-D3-C7-09-2A-63-E9-AD-8F-D0-A8-EF-BA-CF-3C-FB-55-03-B9-83-29-4E-0E-89-84-FB-E2-62-16-1F-9D-87-40-16-6B-F8-F4-66-38-58-74-67-D4-B5-A1-3A-4B-6F-13-4B-08-37-3A-3A-64-0A-06-8E-A2-7B-14-88-B7-F8-CE-6A-D1-45-9B-39-93-67-BF-0A-AB-DB-37-9D-FA-CE-54-0F-37-82-09-8F-0D-33-E4-B8-6E-46-C1-CC-4F-80-5A-B4-BD-19-80-27-40-84-49-02-03-01-00-01-02-81-80-14-95-5A-AD-4D-41-56-B4-F7-42-08-85-87-1C-43-C2-5A-E0-28-16-00-5D-8B-8D-06-B3-34-1D-3F-96-5F-57-D7-2B-B4-45-15-CE-7D-33-B0-F4-ED-36-55-CA-AD-C9-FA-4D-C9-30-E8-FE-C0-D5-16-92-6F-4C-44-5A-1B-9D-7E-AE-B8-01-6D-38-9D-DC-93-68-AB-93-D6-C0-8A-8A-63-B4-D6-DA-21-C1-A0-28-8C-24-C4-27-E1-4B-30-D2-2D-87-62-F9-17-75-21-5E-E1-3C-E2-2D-92-03-C6-A1-8D-1D-E9-67-F4-CE-FF-AC-52-86-D2-F5-0F-EB-03-01-02-41-00-ED-6A-AE-A7-33-B0-B8-86-36-91-BA-E7-D2-DD-15-3A-97-A2-66-31-98-24-A6-0D-E7-09-E3-BD-36-79-91-F2-5E-23-AA-21-C9-71-43-24-10-FA-F0-E6-FC-E4-C6-1F-08-45-E8-91-74-13-69-63-A5-40-8F-38-44-2B-54-69-02-41-00-E6-FE-39-8B-6F-DB-44-CA-E7-72-D3-CA-09-5B-3D-B1-53-85-29-36-FC-F1-B9-D8-1F-64-02-D4-F7-F5-71-E5-9F-17-D7-F3-9F-5A-3A-A6-A3-62-46-F6-93-3D-D3-CD-18-F2-12-BD-68-02-AA-91-55-DA-64-26-D7-16-34-E1-02-40-60-3F-F4-C8-72-4B-3D-B3-A3-A1-D6-FD-2E-DE-54-41-E9-C1-7B-DE-B5-48-7E-4D-7A-91-E6-D3-09-A7-A5-84-75-A7-CD-CC-5E-C7-5D-29-DC-FC-6E-F7-A6-24-F5-31-15-80-89-F5-95-F2-5C-B2-7A-07-3F-48-D7-52-1D-A9-02-40-40-1B-FC-C2-9B-57-E2-DE-E1-9F-B7-F2-11-E8-B5-D5-9A-55-91-DB-C6-16-1C-BB-43-F3-10-EA-24-AB-85-61-F2-66-BE-B3-C9-DD-53-FB-DD-CA-AF-E1-4D-7A-52-67-50-EE-16-8F-64-E7-A0-89-57-A7-96-36-45-69-CF-61-02-40-3D-9E-E3-29-D6-BD-59-FF-A5-C3-AC-57-CB-74-FE-B0-C3-67-34-A8-40-EB-04-88-C3-C2-74-4F-69-77-13-48-8A-97-3C-C2-4B-CD-E8-E0-97-98-A2-3F-B6-E2-71-D3-65-9F-5A-C6-C8-AE-FE-BA-B1-ED-DA-08-8A-5B-7B-12", BitConverter.ToString (p8.PrivateKey));
-                       AssertEquals ("Version", 0, p8.Version);
+                       Assert.AreEqual ("1.2.840.113549.1.1.1", p8.Algorithm, "Algorithm");
+                       Assert.AreEqual (0, p8.Attributes.Count, "Attributes");
+                       Assert.AreEqual ("30-82-02-5B-02-01-00-02-81-81-00-D6-39-9E-21-93-E2-BA-35-7F-E5-F8-E8-87-0B-8A-5F-28-25-85-B7-E5-CC-DA-7F-D3-C7-09-2A-63-E9-AD-8F-D0-A8-EF-BA-CF-3C-FB-55-03-B9-83-29-4E-0E-89-84-FB-E2-62-16-1F-9D-87-40-16-6B-F8-F4-66-38-58-74-67-D4-B5-A1-3A-4B-6F-13-4B-08-37-3A-3A-64-0A-06-8E-A2-7B-14-88-B7-F8-CE-6A-D1-45-9B-39-93-67-BF-0A-AB-DB-37-9D-FA-CE-54-0F-37-82-09-8F-0D-33-E4-B8-6E-46-C1-CC-4F-80-5A-B4-BD-19-80-27-40-84-49-02-03-01-00-01-02-81-80-14-95-5A-AD-4D-41-56-B4-F7-42-08-85-87-1C-43-C2-5A-E0-28-16-00-5D-8B-8D-06-B3-34-1D-3F-96-5F-57-D7-2B-B4-45-15-CE-7D-33-B0-F4-ED-36-55-CA-AD-C9-FA-4D-C9-30-E8-FE-C0-D5-16-92-6F-4C-44-5A-1B-9D-7E-AE-B8-01-6D-38-9D-DC-93-68-AB-93-D6-C0-8A-8A-63-B4-D6-DA-21-C1-A0-28-8C-24-C4-27-E1-4B-30-D2-2D-87-62-F9-17-75-21-5E-E1-3C-E2-2D-92-03-C6-A1-8D-1D-E9-67-F4-CE-FF-AC-52-86-D2-F5-0F-EB-03-01-02-41-00-ED-6A-AE-A7-33-B0-B8-86-36-91-BA-E7-D2-DD-15-3A-97-A2-66-31-98-24-A6-0D-E7-09-E3-BD-36-79-91-F2-5E-23-AA-21-C9-71-43-24-10-FA-F0-E6-FC-E4-C6-1F-08-45-E8-91-74-13-69-63-A5-40-8F-38-44-2B-54-69-02-41-00-E6-FE-39-8B-6F-DB-44-CA-E7-72-D3-CA-09-5B-3D-B1-53-85-29-36-FC-F1-B9-D8-1F-64-02-D4-F7-F5-71-E5-9F-17-D7-F3-9F-5A-3A-A6-A3-62-46-F6-93-3D-D3-CD-18-F2-12-BD-68-02-AA-91-55-DA-64-26-D7-16-34-E1-02-40-60-3F-F4-C8-72-4B-3D-B3-A3-A1-D6-FD-2E-DE-54-41-E9-C1-7B-DE-B5-48-7E-4D-7A-91-E6-D3-09-A7-A5-84-75-A7-CD-CC-5E-C7-5D-29-DC-FC-6E-F7-A6-24-F5-31-15-80-89-F5-95-F2-5C-B2-7A-07-3F-48-D7-52-1D-A9-02-40-40-1B-FC-C2-9B-57-E2-DE-E1-9F-B7-F2-11-E8-B5-D5-9A-55-91-DB-C6-16-1C-BB-43-F3-10-EA-24-AB-85-61-F2-66-BE-B3-C9-DD-53-FB-DD-CA-AF-E1-4D-7A-52-67-50-EE-16-8F-64-E7-A0-89-57-A7-96-36-45-69-CF-61-02-40-3D-9E-E3-29-D6-BD-59-FF-A5-C3-AC-57-CB-74-FE-B0-C3-67-34-A8-40-EB-04-88-C3-C2-74-4F-69-77-13-48-8A-97-3C-C2-4B-CD-E8-E0-97-98-A2-3F-B6-E2-71-D3-65-9F-5A-C6-C8-AE-FE-BA-B1-ED-DA-08-8A-5B-7B-12", BitConverter.ToString (p8.PrivateKey), "PrivateKey");
+                       Assert.AreEqual (0, p8.Version, "Version");
                        // static
                        RSA rsa = PKCS8.PrivateKeyInfo.DecodeRSA (p8.PrivateKey);
-                       AssertEquals ("DecodeRSA", "<RSAKeyValue><Modulus>1jmeIZPiujV/5fjohwuKXyglhbflzNp/08cJKmPprY/QqO+6zzz7VQO5gylODomE++JiFh+dh0AWa/j0ZjhYdGfUtaE6S28TSwg3OjpkCgaOonsUiLf4zmrRRZs5k2e/CqvbN536zlQPN4IJjw0z5LhuRsHMT4BatL0ZgCdAhEk=</Modulus><Exponent>AQAB</Exponent><P>7WqupzOwuIY2kbrn0t0VOpeiZjGYJKYN5wnjvTZ5kfJeI6ohyXFDJBD68Ob85MYfCEXokXQTaWOlQI84RCtUaQ==</P><Q>5v45i2/bRMrnctPKCVs9sVOFKTb88bnYH2QC1Pf1ceWfF9fzn1o6pqNiRvaTPdPNGPISvWgCqpFV2mQm1xY04Q==</Q><DP>YD/0yHJLPbOjodb9Lt5UQenBe961SH5NepHm0wmnpYR1p83MXsddKdz8bvemJPUxFYCJ9ZXyXLJ6Bz9I11IdqQ==</DP><DQ>QBv8wptX4t7hn7fyEei11ZpVkdvGFhy7Q/MQ6iSrhWHyZr6zyd1T+93Kr+FNelJnUO4Wj2TnoIlXp5Y2RWnPYQ==</DQ><InverseQ>PZ7jKda9Wf+lw6xXy3T+sMNnNKhA6wSIw8J0T2l3E0iKlzzCS83o4JeYoj+24nHTZZ9axsiu/rqx7doIilt7Eg==</InverseQ><D>FJVarU1BVrT3QgiFhxxDwlrgKBYAXYuNBrM0HT+WX1fXK7RFFc59M7D07TZVyq3J+k3JMOj+wNUWkm9MRFobnX6uuAFtOJ3ck2irk9bAiopjtNbaIcGgKIwkxCfhSzDSLYdi+Rd1IV7hPOItkgPGoY0d6Wf0zv+sUobS9Q/rAwE=</D></RSAKeyValue>", rsa.ToXmlString (true));
+                       Assert.AreEqual ("<RSAKeyValue><Modulus>1jmeIZPiujV/5fjohwuKXyglhbflzNp/08cJKmPprY/QqO+6zzz7VQO5gylODomE++JiFh+dh0AWa/j0ZjhYdGfUtaE6S28TSwg3OjpkCgaOonsUiLf4zmrRRZs5k2e/CqvbN536zlQPN4IJjw0z5LhuRsHMT4BatL0ZgCdAhEk=</Modulus><Exponent>AQAB</Exponent><P>7WqupzOwuIY2kbrn0t0VOpeiZjGYJKYN5wnjvTZ5kfJeI6ohyXFDJBD68Ob85MYfCEXokXQTaWOlQI84RCtUaQ==</P><Q>5v45i2/bRMrnctPKCVs9sVOFKTb88bnYH2QC1Pf1ceWfF9fzn1o6pqNiRvaTPdPNGPISvWgCqpFV2mQm1xY04Q==</Q><DP>YD/0yHJLPbOjodb9Lt5UQenBe961SH5NepHm0wmnpYR1p83MXsddKdz8bvemJPUxFYCJ9ZXyXLJ6Bz9I11IdqQ==</DP><DQ>QBv8wptX4t7hn7fyEei11ZpVkdvGFhy7Q/MQ6iSrhWHyZr6zyd1T+93Kr+FNelJnUO4Wj2TnoIlXp5Y2RWnPYQ==</DQ><InverseQ>PZ7jKda9Wf+lw6xXy3T+sMNnNKhA6wSIw8J0T2l3E0iKlzzCS83o4JeYoj+24nHTZZ9axsiu/rqx7doIilt7Eg==</InverseQ><D>FJVarU1BVrT3QgiFhxxDwlrgKBYAXYuNBrM0HT+WX1fXK7RFFc59M7D07TZVyq3J+k3JMOj+wNUWkm9MRFobnX6uuAFtOJ3ck2irk9bAiopjtNbaIcGgKIwkxCfhSzDSLYdi+Rd1IV7hPOItkgPGoY0d6Wf0zv+sUobS9Q/rAwE=</D></RSAKeyValue>", rsa.ToXmlString (true), "DecodeRSA");
                }
 
                [Test]
@@ -109,31 +109,31 @@ namespace MonoTests.Mono.Security.Cryptography {
                public void PrivateKeyInfo () 
                {
                        PKCS8.PrivateKeyInfo p8 = new PKCS8.PrivateKeyInfo ();
-                       AssertNull ("Default-Algorithm", p8.Algorithm);
-                       AssertEquals ("Default-Attributes", 0, p8.Attributes.Count);
-                       AssertNull ("Default-PrivateKey", p8.PrivateKey);
-                       AssertEquals ("Default-Version", 0, p8.Version);
+                       Assert.IsNull (p8.Algorithm, "Default-Algorithm");
+                       Assert.AreEqual (0, p8.Attributes.Count, "Default-Attributes");
+                       Assert.IsNull (p8.PrivateKey, "Default-PrivateKey");
+                       Assert.AreEqual (0, p8.Version, "Default-Version");
                        
                        byte[] key = new byte [8];
                        p8.Algorithm = "1.2.3.4.5";
                        p8.Attributes.Add (new ASN1 (0x05)); // NULL
                        p8.PrivateKey = key;
                        p8.Version = 1;
-                       AssertEquals ("Algorithm", "1.2.3.4.5", p8.Algorithm);
-                       AssertEquals ("Attributes", 1, p8.Attributes.Count);
-                       AssertEquals ("PrivateKey", 8, p8.PrivateKey.Length);
-                       AssertEquals ("Version", 1, p8.Version);
+                       Assert.AreEqual ("1.2.3.4.5", p8.Algorithm, "Algorithm");
+                       Assert.AreEqual (1, p8.Attributes.Count, "Attributes");
+                       Assert.AreEqual (8, p8.PrivateKey.Length, "PrivateKey");
+                       Assert.AreEqual (1, p8.Version, "Version");
                        
                        key [0] = 1;
-                       AssertEquals ("PrivateKey not directly accessible", 0, p8.PrivateKey [0]);
+                       Assert.AreEqual (0, p8.PrivateKey [0], "PrivateKey not directly accessible");
                        
                        byte[] p8pki = p8.GetBytes ();
                        
                        PKCS8.PrivateKeyInfo decoded = new PKCS8.PrivateKeyInfo (p8pki);
-                       AssertEquals ("Decoded-Algorithm", "1.2.3.4.5", decoded.Algorithm);
-                       AssertEquals ("Decoded-Attributes", 1, decoded.Attributes.Count);
-                       AssertEquals ("Decoded-PrivateKey", 8, decoded.PrivateKey.Length);
-                       AssertEquals ("Decoded-Version", 1, decoded.Version);
+                       Assert.AreEqual ("1.2.3.4.5", decoded.Algorithm, "Decoded-Algorithm");
+                       Assert.AreEqual (1, decoded.Attributes.Count, "Decoded-Attributes");
+                       Assert.AreEqual (8, decoded.PrivateKey.Length, "Decoded-PrivateKey");
+                       Assert.AreEqual (1, decoded.Version, "Decoded-Version");
                }
                
                [Test]
index ba0f403e8a78b8a23117ec43c446fa1ec60b3240..ef27bd73630b3446ad88310a6591eb3ba0d5d741 100644 (file)
@@ -17,7 +17,7 @@ using NUnit.Framework;
 namespace MonoTests.Mono.Security.Protocol.Ntlm {
 
        [TestFixture]
-       public class ChallengeResponseTest : Assertion {
+       public class ChallengeResponseTest {
 
                [Test]
                // Example from http://www.innovation.ch/java/ntlm.html
@@ -25,8 +25,8 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                {
                        byte[] SrvNonce = Encoding.ASCII.GetBytes ("SrvNonce");
                        using (ChallengeResponse ntlm = new ChallengeResponse ("Beeblebrox", SrvNonce)) {
-                               AssertEquals ("NT", "E0-E0-0D-E3-10-4A-1B-F2-05-3F-07-C7-DD-A8-2D-3C-48-9A-E9-89-E1-B0-00-D3", BitConverter.ToString (ntlm.NT));
-                               AssertEquals ("LM", "AD-87-CA-6D-EF-E3-46-85-B9-C4-3C-47-7A-8C-42-D6-00-66-7D-68-92-E7-E8-97", BitConverter.ToString (ntlm.LM));
+                               Assert.AreEqual ("E0-E0-0D-E3-10-4A-1B-F2-05-3F-07-C7-DD-A8-2D-3C-48-9A-E9-89-E1-B0-00-D3", BitConverter.ToString (ntlm.NT), "NT");
+                               Assert.AreEqual ("AD-87-CA-6D-EF-E3-46-85-B9-C4-3C-47-7A-8C-42-D6-00-66-7D-68-92-E7-E8-97", BitConverter.ToString (ntlm.LM), "LM");
                        }
                }
 
@@ -36,8 +36,8 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                {
                        byte[] SrvNonce = new byte [8] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };
                        using (ChallengeResponse ntlm = new ChallengeResponse ("WELCOME", SrvNonce)) {
-                               AssertEquals ("NT", "7A-CE-90-85-AB-CC-37-59-38-0B-1C-68-62-E3-98-C3-C0-EF-9C-FC-22-E8-A2-C2", BitConverter.ToString (ntlm.NT));
-                               AssertEquals ("LM", "CA-12-00-72-3C-41-D5-77-AB-18-C7-64-C6-DE-F3-4F-A6-1B-FA-06-71-EA-5F-C8", BitConverter.ToString (ntlm.LM));
+                               Assert.AreEqual ("7A-CE-90-85-AB-CC-37-59-38-0B-1C-68-62-E3-98-C3-C0-EF-9C-FC-22-E8-A2-C2", BitConverter.ToString (ntlm.NT), "NT");
+                               Assert.AreEqual ("CA-12-00-72-3C-41-D5-77-AB-18-C7-64-C6-DE-F3-4F-A6-1B-FA-06-71-EA-5F-C8", BitConverter.ToString (ntlm.LM), "LM");
                        }
                }
 
@@ -46,9 +46,9 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                {
                        byte[] SrvNonce = new byte [8] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };
                        using (ChallengeResponse ntlm = new ChallengeResponse (null, SrvNonce)) {
-                               AssertEquals ("NT", "4A-FD-81-EC-01-87-E8-8D-97-77-8D-F7-93-C6-DA-D4-F0-3A-36-63-66-9D-20-1C", BitConverter.ToString (ntlm.NT));
+                               Assert.AreEqual ("4A-FD-81-EC-01-87-E8-8D-97-77-8D-F7-93-C6-DA-D4-F0-3A-36-63-66-9D-20-1C", BitConverter.ToString (ntlm.NT), "NT");
                                // note the last 8 bytes... they are the same as the previous unit test ;-)
-                               AssertEquals ("LM", "0A-39-2B-11-CF-05-2B-02-6D-65-CF-F5-68-BD-E4-15-A6-1B-FA-06-71-EA-5F-C8", BitConverter.ToString (ntlm.LM));
+                               Assert.AreEqual ("0A-39-2B-11-CF-05-2B-02-6D-65-CF-F5-68-BD-E4-15-A6-1B-FA-06-71-EA-5F-C8", BitConverter.ToString (ntlm.LM), "LM");
                        }
                }
 
@@ -58,8 +58,8 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                        byte[] SrvNonce = new byte [8] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };
                        using (ChallengeResponse ntlm = new ChallengeResponse (String.Empty, SrvNonce)) {
                                // same as the previous one as this is the same (null/empty) password expressed diffently
-                               AssertEquals ("NT", "4A-FD-81-EC-01-87-E8-8D-97-77-8D-F7-93-C6-DA-D4-F0-3A-36-63-66-9D-20-1C", BitConverter.ToString (ntlm.NT));
-                               AssertEquals ("LM", "0A-39-2B-11-CF-05-2B-02-6D-65-CF-F5-68-BD-E4-15-A6-1B-FA-06-71-EA-5F-C8", BitConverter.ToString (ntlm.LM));
+                               Assert.AreEqual ("4A-FD-81-EC-01-87-E8-8D-97-77-8D-F7-93-C6-DA-D4-F0-3A-36-63-66-9D-20-1C", BitConverter.ToString (ntlm.NT), "NT");
+                               Assert.AreEqual ("0A-39-2B-11-CF-05-2B-02-6D-65-CF-F5-68-BD-E4-15-A6-1B-FA-06-71-EA-5F-C8", BitConverter.ToString (ntlm.LM), "LM");
                        }
                }
                
@@ -68,8 +68,8 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                {
                        ChallengeResponse ntlm = new ChallengeResponse ("Mono", new byte [8]);
                        // no out!
-                       AssertNull ("Password", ntlm.Password);
-                       AssertNull ("Challenge", ntlm.Challenge);
+                       Assert.IsNull (ntlm.Password, "Password");
+                       Assert.IsNull (ntlm.Challenge, "Challenge");
                }
                
                [Test] 
@@ -104,7 +104,7 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                {
                        ChallengeResponse ntlm = new ChallengeResponse ("Mono", new byte [8]);
                        ntlm.Dispose ();
-                       AssertNotNull ("NT", ntlm.NT);
+                       Assert.IsNotNull (ntlm.NT, "NT");
                }
 
                [Test] 
@@ -113,7 +113,7 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                {
                        ChallengeResponse ntlm = new ChallengeResponse ("Mono", new byte [8]);
                        ntlm.Dispose ();
-                       AssertNotNull ("LM", ntlm.LM);
+                       Assert.IsNotNull (ntlm.LM, "LM");
                }
        }
 }
index 7164640be9b3d900fa1ac0ef05005fa76a8d4e9b..a02816fadc7542c256c2a71d3d7dcac870eda17d 100644 (file)
@@ -15,7 +15,7 @@ using NUnit.Framework;
 namespace MonoTests.Mono.Security.Protocol.Ntlm {
 
        [TestFixture]
-       public class MessageBaseTest : Assertion {
+       public class MessageBaseTest {
        
                // 
        
@@ -42,4 +42,4 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                }
 
        }
-}
\ No newline at end of file
+}
index c6dc2394d9393ce12cdb6746a6589f34d02ca375..5bd097e1d489536dcf85eb6931663b6099fd49f3 100644 (file)
@@ -16,17 +16,17 @@ using NUnit.Framework;
 namespace MonoTests.Mono.Security.Protocol.Ntlm {
 
        [TestFixture]
-       public class Type1MessageTest : Assertion {
+       public class Type1MessageTest {
 
                [Test]
                // Example from http://www.innovation.ch/java/ntlm.html
                public void Encode1 () 
                {
                        Type1Message msg = new Type1Message ();
-                       AssertEquals ("Type", 1, msg.Type);
+                       Assert.AreEqual (1, msg.Type, "Type");
                        msg.Domain = "Ursa-Minor";
                        msg.Host = "LightCity";
-                       AssertEquals ("GetBytes", "4E-54-4C-4D-53-53-50-00-01-00-00-00-07-B2-00-00-0A-00-0A-00-29-00-00-00-09-00-09-00-20-00-00-00-4C-49-47-48-54-43-49-54-59-55-52-53-41-2D-4D-49-4E-4F-52", BitConverter.ToString (msg.GetBytes ()));
+                       Assert.AreEqual ("4E-54-4C-4D-53-53-50-00-01-00-00-00-07-B2-00-00-0A-00-0A-00-29-00-00-00-09-00-09-00-20-00-00-00-4C-49-47-48-54-43-49-54-59-55-52-53-41-2D-4D-49-4E-4F-52", BitConverter.ToString (msg.GetBytes ()), "GetBytes");
                }
 
                [Test]
@@ -35,10 +35,10 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                {
                        byte[] data = { 0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0xb2, 0x00, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x29, 0x00, 0x00, 0x00, 0x09, 0x00, 0x09, 0x00, 0x20, 0x00, 0x00, 0x00, 0x4c, 0x49, 0x47, 0x48, 0x54, 0x43, 0x49, 0x54, 0x59, 0x55, 0x52, 0x53, 0x41, 0x2d, 0x4d, 0x49, 0x4e, 0x4f, 0x52 };
                        Type1Message msg = new Type1Message (data);
-                       AssertEquals ("Domain", "URSA-MINOR", msg.Domain);
-                       AssertEquals ("Flags", (NtlmFlags)0xb203, msg.Flags);
-                       AssertEquals ("Host", "LIGHTCITY", msg.Host);
-                       AssertEquals ("Type", 1, msg.Type);
+                       Assert.AreEqual ("URSA-MINOR", msg.Domain, "Domain");
+                       Assert.AreEqual ((NtlmFlags)0xb203, msg.Flags, "Flags");
+                       Assert.AreEqual ("LIGHTCITY", msg.Host, "Host");
+                       Assert.AreEqual (1, msg.Type, "Type");
                }
 
                [Test]
@@ -47,10 +47,10 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                {
                        byte[] data = { 0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x32, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x0b, 0x00, 0x20, 0x00, 0x00, 0x00, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x44, 0x4f, 0x4d, 0x41, 0x49, 0x4e };
                        Type1Message msg = new Type1Message (data);
-                       AssertEquals ("Domain", "DOMAIN", msg.Domain);
-                       AssertEquals ("Flags", (NtlmFlags)0x3207, msg.Flags);
-                       AssertEquals ("Host", "WORKSTATION", msg.Host);
-                       AssertEquals ("Type", 1, msg.Type);
+                       Assert.AreEqual ("DOMAIN", msg.Domain, "Domain");
+                       Assert.AreEqual ((NtlmFlags)0x3207, msg.Flags, "Flags");
+                       Assert.AreEqual ("WORKSTATION", msg.Host, "Host");
+                       Assert.AreEqual (1, msg.Type, "Type");
                }
        }
 }
index bd1b38349a35d8eade0e4cd808ad1bdd56060188..6233e0fe7555d76f028e809f0295ea67864a6110 100644 (file)
@@ -17,7 +17,7 @@ using NUnit.Framework;
 namespace MonoTests.Mono.Security.Protocol.Ntlm {
 
        [TestFixture]
-       public class Type2MessageTest : Assertion {
+       public class Type2MessageTest {
 
                static byte[] nonce = { 0x53, 0x72, 0x76, 0x4e, 0x6f, 0x6e, 0x63, 0x65 };
 
@@ -26,9 +26,9 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                public void Encode1 () 
                {
                        Type2Message msg = new Type2Message ();
-                       AssertEquals ("Type", 2, msg.Type);
+                       Assert.AreEqual (2, msg.Type, "Type");
                        msg.Nonce = nonce;
-                       AssertEquals ("GetBytes", "4E-54-4C-4D-53-53-50-00-02-00-00-00-00-00-00-00-28-00-00-00-01-82-00-00-53-72-76-4E-6F-6E-63-65-00-00-00-00-00-00-00-00", BitConverter.ToString (msg.GetBytes ()));
+                       Assert.AreEqual ("4E-54-4C-4D-53-53-50-00-02-00-00-00-00-00-00-00-28-00-00-00-01-82-00-00-53-72-76-4E-6F-6E-63-65-00-00-00-00-00-00-00-00", BitConverter.ToString (msg.GetBytes ()), "GetBytes");
                }
 
                [Test]
@@ -37,9 +37,9 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                {
                        byte[] data = { 0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x01, 0x82, 0x00, 0x00, 0x53, 0x72, 0x76, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
                        Type2Message msg = new Type2Message (data);
-                       AssertEquals ("Flags", (NtlmFlags)0x8201, msg.Flags);
-                       AssertEquals ("Nonce", BitConverter.ToString (nonce), BitConverter.ToString (msg.Nonce));
-                       AssertEquals ("Type", 2, msg.Type);
+                       Assert.AreEqual ((NtlmFlags)0x8201, msg.Flags, "Flags");
+                       Assert.AreEqual (BitConverter.ToString (nonce), BitConverter.ToString (msg.Nonce), "Nonce");
+                       Assert.AreEqual (2, msg.Type, "Type");
                }
 
                [Test]
@@ -48,9 +48,9 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                {
                        byte[] data = { 0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x30, 0x00, 0x00, 0x00, 0x01, 0x02, 0x81, 0x00, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x00, 0x62, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x44, 0x00, 0x4f, 0x00, 0x4d, 0x00, 0x41, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x44, 0x00, 0x4f, 0x00, 0x4d, 0x00, 0x41, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x53, 0x00, 0x45, 0x00, 0x52, 0x00, 0x56, 0x00, 0x45, 0x00, 0x52, 0x00, 0x04, 0x00, 0x14, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x2e, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x03, 0x00, 0x22, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x2e, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x2e, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00 };
                        Type2Message msg = new Type2Message (data);
-                       AssertEquals ("Flags", (NtlmFlags)0x00810201, msg.Flags);
-                       AssertEquals ("Nonce", "01-23-45-67-89-AB-CD-EF", BitConverter.ToString (msg.Nonce));
-                       AssertEquals ("Type", 2, msg.Type);
+                       Assert.AreEqual ((NtlmFlags)0x00810201, msg.Flags, "Flags");
+                       Assert.AreEqual ("01-23-45-67-89-AB-CD-EF", BitConverter.ToString (msg.Nonce), "Nonce");
+                       Assert.AreEqual (2, msg.Type, "Type");
                }
                
                [Test]
index febcb79755259ea869d3b4848d4cf458fab55bf8..e9343cc979f81b700f488fca84f1f487531308eb 100644 (file)
@@ -17,7 +17,7 @@ using NUnit.Framework;
 namespace MonoTests.Mono.Security.Protocol.Ntlm {
 
        [TestFixture]
-       public class Type3MessageTest : Assertion {
+       public class Type3MessageTest {
 
                static byte[] nonce = { 0x53, 0x72, 0x76, 0x4e, 0x6f, 0x6e, 0x63, 0x65 };
 
@@ -40,8 +40,8 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                        msg.Host = "HOST";
                        msg.Password = "WELCOME";
                        msg.Username = "username";
-                       AssertEquals ("Type", 3, msg.Type);
-                       AssertEquals ("GetBytes", "4E-54-4C-4D-53-53-50-00-03-00-00-00-18-00-18-00-64-00-00-00-18-00-18-00-7C-00-00-00-0C-00-0C-00-40-00-00-00-10-00-10-00-4C-00-00-00-08-00-08-00-5C-00-00-00-00-00-00-00-94-00-00-00-01-B2-00-00-44-00-4F-00-4D-00-41-00-49-00-4E-00-75-00-73-00-65-00-72-00-6E-00-61-00-6D-00-65-00-48-00-4F-00-53-00-54-00-CA-12-00-72-3C-41-D5-77-AB-18-C7-64-C6-DE-F3-4F-A6-1B-FA-06-71-EA-5F-C8-7A-CE-90-85-AB-CC-37-59-38-0B-1C-68-62-E3-98-C3-C0-EF-9C-FC-22-E8-A2-C2", BitConverter.ToString (msg.GetBytes ()));
+                       Assert.AreEqual (3, msg.Type, "Type");
+                       Assert.AreEqual ("4E-54-4C-4D-53-53-50-00-03-00-00-00-18-00-18-00-64-00-00-00-18-00-18-00-7C-00-00-00-0C-00-0C-00-40-00-00-00-10-00-10-00-4C-00-00-00-08-00-08-00-5C-00-00-00-00-00-00-00-94-00-00-00-01-B2-00-00-44-00-4F-00-4D-00-41-00-49-00-4E-00-75-00-73-00-65-00-72-00-6E-00-61-00-6D-00-65-00-48-00-4F-00-53-00-54-00-CA-12-00-72-3C-41-D5-77-AB-18-C7-64-C6-DE-F3-4F-A6-1B-FA-06-71-EA-5F-C8-7A-CE-90-85-AB-CC-37-59-38-0B-1C-68-62-E3-98-C3-C0-EF-9C-FC-22-E8-A2-C2", BitConverter.ToString (msg.GetBytes ()), "GetBytes");
                }
 
                [Test]
@@ -55,8 +55,8 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                        msg.Host = "LIGHTCITY";
                        msg.Password = "Beeblebrox";
                        msg.Username = "Zaphod";
-                       AssertEquals ("Type", 3, msg.Type);
-                       AssertEquals ("GetBytes", "4E-54-4C-4D-53-53-50-00-03-00-00-00-18-00-18-00-72-00-00-00-18-00-18-00-8A-00-00-00-14-00-14-00-40-00-00-00-0C-00-0C-00-54-00-00-00-12-00-12-00-60-00-00-00-00-00-00-00-A2-00-00-00-01-B2-00-00-55-00-52-00-53-00-41-00-2D-00-4D-00-49-00-4E-00-4F-00-52-00-5A-00-61-00-70-00-68-00-6F-00-64-00-4C-00-49-00-47-00-48-00-54-00-43-00-49-00-54-00-59-00-AD-87-CA-6D-EF-E3-46-85-B9-C4-3C-47-7A-8C-42-D6-00-66-7D-68-92-E7-E8-97-E0-E0-0D-E3-10-4A-1B-F2-05-3F-07-C7-DD-A8-2D-3C-48-9A-E9-89-E1-B0-00-D3", BitConverter.ToString (msg.GetBytes ()));
+                       Assert.AreEqual (3, msg.Type, "Type");
+                       Assert.AreEqual ("4E-54-4C-4D-53-53-50-00-03-00-00-00-18-00-18-00-72-00-00-00-18-00-18-00-8A-00-00-00-14-00-14-00-40-00-00-00-0C-00-0C-00-54-00-00-00-12-00-12-00-60-00-00-00-00-00-00-00-A2-00-00-00-01-B2-00-00-55-00-52-00-53-00-41-00-2D-00-4D-00-49-00-4E-00-4F-00-52-00-5A-00-61-00-70-00-68-00-6F-00-64-00-4C-00-49-00-47-00-48-00-54-00-43-00-49-00-54-00-59-00-AD-87-CA-6D-EF-E3-46-85-B9-C4-3C-47-7A-8C-42-D6-00-66-7D-68-92-E7-E8-97-E0-E0-0D-E3-10-4A-1B-F2-05-3F-07-C7-DD-A8-2D-3C-48-9A-E9-89-E1-B0-00-D3", BitConverter.ToString (msg.GetBytes ()), "GetBytes");
                }
 
                [Test]
@@ -64,14 +64,14 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                public void Decode1 () 
                {
                        Type3Message msg = new Type3Message (data1);
-                       AssertEquals ("Domain", "URSA-MINOR", msg.Domain);
-                       AssertEquals ("Host", "LIGHTCITY", msg.Host);
-                       AssertEquals ("Username", "Zaphod", msg.Username);
-                       AssertEquals ("Flags", (NtlmFlags)0x8201, msg.Flags);
-                       AssertEquals ("Type", 3, msg.Type);
-                       AssertNull ("Password", msg.Password);
-                       AssertEquals ("LM", "AD-87-CA-6D-EF-E3-46-85-B9-C4-3C-47-7A-8C-42-D6-00-66-7D-68-92-E7-E8-97", BitConverter.ToString (msg.LM));
-                       AssertEquals ("NT", "E0-E0-0D-E3-10-4A-1B-F2-05-3F-07-C7-DD-A8-2D-3C-48-9A-E9-89-E1-B0-00-D3", BitConverter.ToString (msg.NT));
+                       Assert.AreEqual ("URSA-MINOR", msg.Domain, "Domain");
+                       Assert.AreEqual ("LIGHTCITY", msg.Host, "Host");
+                       Assert.AreEqual ("Zaphod", msg.Username, "Username");
+                       Assert.AreEqual ((NtlmFlags)0x8201, msg.Flags, "Flags");
+                       Assert.AreEqual (3, msg.Type, "Type");
+                       Assert.IsNull (msg.Password, "Password");
+                       Assert.AreEqual ("AD-87-CA-6D-EF-E3-46-85-B9-C4-3C-47-7A-8C-42-D6-00-66-7D-68-92-E7-E8-97", BitConverter.ToString (msg.LM), "LM");
+                       Assert.AreEqual ("E0-E0-0D-E3-10-4A-1B-F2-05-3F-07-C7-DD-A8-2D-3C-48-9A-E9-89-E1-B0-00-D3", BitConverter.ToString (msg.NT), "NT");
                }
 
                [Test]
@@ -79,28 +79,28 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
                public void Decode2 () 
                {
                        Type3Message msg = new Type3Message (data2);
-                       AssertEquals ("Domain", "DOMAIN", msg.Domain);
-                       AssertEquals ("Host", "WORKSTATION", msg.Host);
-                       AssertEquals ("Username", "user", msg.Username);
-                       AssertEquals ("Flags", (NtlmFlags)0x201, msg.Flags);
-                       AssertEquals ("Type", 3, msg.Type);
-                       AssertNull ("Password", msg.Password);
-                       AssertEquals ("LM", "C3-37-CD-5C-BD-44-FC-97-82-A6-67-AF-6D-42-7C-6D-E6-7C-20-C2-D3-E7-7C-56", BitConverter.ToString (msg.LM));
-                       AssertEquals ("NT", "25-A9-8C-1C-31-E8-18-47-46-6B-29-B2-DF-46-80-F3-99-58-FB-8C-21-3A-9C-C6", BitConverter.ToString (msg.NT));
+                       Assert.AreEqual ("DOMAIN", msg.Domain, "Domain");
+                       Assert.AreEqual ("WORKSTATION", msg.Host, "Host");
+                       Assert.AreEqual ("user", msg.Username, "Username");
+                       Assert.AreEqual ((NtlmFlags)0x201, msg.Flags, "Flags");
+                       Assert.AreEqual (3, msg.Type, "Type");
+                       Assert.IsNull (msg.Password, "Password");
+                       Assert.AreEqual ("C3-37-CD-5C-BD-44-FC-97-82-A6-67-AF-6D-42-7C-6D-E6-7C-20-C2-D3-E7-7C-56", BitConverter.ToString (msg.LM), "LM");
+                       Assert.AreEqual ("25-A9-8C-1C-31-E8-18-47-46-6B-29-B2-DF-46-80-F3-99-58-FB-8C-21-3A-9C-C6", BitConverter.ToString (msg.NT), "NT");
                }
 
                [Test]
                public void Challenge () 
                {
                        Type3Message msg = new Type3Message ();
-                       AssertNull ("Challenge", msg.Challenge);
+                       Assert.IsNull (msg.Challenge, "Challenge");
                        
                        byte[] c = new byte [8];
                        msg.Challenge = c;
-                       AssertEquals ("Challenge.Length", 8, msg.Challenge.Length);
+                       Assert.AreEqual (8, msg.Challenge.Length, "Challenge.Length");
                        
                        c [0] = 1;
-                       AssertEquals ("Challenge not directly accessible", 0, msg.Challenge [0]);
+                       Assert.AreEqual (0, msg.Challenge [0], "Challenge not directly accessible");
                }
                
                [Test]
index 05e013cd4aa2a26d7080df77256a51e636311396..fe94f26e01bcb9dd8663c2aeceb2686b9c3e4410 100644 (file)
@@ -22,7 +22,7 @@ namespace MonoTests.Mono.Security {
        // sn -k test.snk
 
        [TestFixture]
-       public class StrongNameTest : Assertion {
+       public class StrongNameTest {
 
                // because most crypto stuff works with byte[] buffers
                static public void AssertEquals (string msg, byte[] array1, byte[] array2) 
@@ -30,9 +30,9 @@ namespace MonoTests.Mono.Security {
                        if ((array1 == null) && (array2 == null))
                                return;
                        if (array1 == null)
-                               Fail (msg + " -> First array is NULL");
+                               Assert.Fail (msg + " -> First array is NULL");
                        if (array2 == null)
-                               Fail (msg + " -> Second array is NULL");
+                               Assert.Fail (msg + " -> Second array is NULL");
 
                        bool a = (array1.Length == array2.Length);
                        if (a) {
@@ -47,7 +47,7 @@ namespace MonoTests.Mono.Security {
                                msg += " -> Expected " + BitConverter.ToString (array1, 0);
                                msg += " is different than " + BitConverter.ToString (array2, 0);
                        }
-                       Assert (msg, a);
+                       Assert.IsTrue (a, msg);
                }
 
                static byte[] test = { 
@@ -112,9 +112,9 @@ namespace MonoTests.Mono.Security {
                public void FromBuffer ()
                {
                        StrongName sn = new StrongName (test);
-                       AssertEquals ("buffer.RSA", "<RSAKeyValue><Modulus>y6T/+EoARJMHW0ilpCdn+VbTffWxb1xu187/9Q+S2DwPyZ9LTNKrZgwaYmG4FPWEEH1HJxrxwh8AlD6oTz8CCcnPGKxKVFkubpIbEyvQCSTr22gUjVXXKHc2pfcCeOuNXS9kAOjv2tqpsiDbIsu9mnxfYysHWMDBqA4rxghyvT0=</Modulus><Exponent>AQAB</Exponent><P>6qYUEleRY+Wzyk7xN05UwWRna37U2aQnq2Y2VVyJeceDZPU1u1GYdQmFQw5XgvxKwWx9DAfNh1iSyLe0YmrAcw==</P><Q>3iy1IDIkPrRWBFrCAUhpUNn4/ICiVXTT7KjuEXkGr0+1Cx/V+o3eoVIo/9x2Q3IaxMbQDSa8hisIFunz/iuPjw==</Q><DP>2BouIBpfvzX8mBSOGNZePmG+0YRUeUCyfCs9XO5Fek9h1mfynVpvY1JqVbBuria2nl7Q53SEN+M+A/cT/RO9uw==</DP><DQ>pjma1ljNh2CTTrS8nAsaSJSc1gZD7l33RQRrAgWju7yN/qG2DbzhSZ9X7355uSKA5qK8/Gnz+QnvBn3JwGvE/w==</DQ><InverseQ>3U67bp3lPExfGoiTRvRyHhNtyJs6hAq/Uj7wSHKLHNoLG20kwZux8BwZKpPBBA0bQjkLUiRv9PYs18El/45/wA==</InverseQ><D>bPVOg5FMjWRBhmTbQ3ZWGkGLjRR9KEFDiTJXHs6DWjDgnZceWe9KB6KoJ0Vzkbs/Ovdcr56qBZxC2g6gTS5ALvogBYH2PrUftr4flh/z4qgOrAYCQkTecfHAGIGEldEeF1FItMbqmQa6WzVPVp4tn/+q3PAVmZqrs6/X9EARH10=</D></RSAKeyValue>", sn.RSA.ToXmlString (true));
-                       AssertEquals ("buffer.PublicKey", testPublicKey, sn.PublicKey);
-                       AssertEquals ("buffer.PublicKeyToken", testPublicKeyToken, sn.PublicKeyToken);
+                       Assert.AreEqual ("<RSAKeyValue><Modulus>y6T/+EoARJMHW0ilpCdn+VbTffWxb1xu187/9Q+S2DwPyZ9LTNKrZgwaYmG4FPWEEH1HJxrxwh8AlD6oTz8CCcnPGKxKVFkubpIbEyvQCSTr22gUjVXXKHc2pfcCeOuNXS9kAOjv2tqpsiDbIsu9mnxfYysHWMDBqA4rxghyvT0=</Modulus><Exponent>AQAB</Exponent><P>6qYUEleRY+Wzyk7xN05UwWRna37U2aQnq2Y2VVyJeceDZPU1u1GYdQmFQw5XgvxKwWx9DAfNh1iSyLe0YmrAcw==</P><Q>3iy1IDIkPrRWBFrCAUhpUNn4/ICiVXTT7KjuEXkGr0+1Cx/V+o3eoVIo/9x2Q3IaxMbQDSa8hisIFunz/iuPjw==</Q><DP>2BouIBpfvzX8mBSOGNZePmG+0YRUeUCyfCs9XO5Fek9h1mfynVpvY1JqVbBuria2nl7Q53SEN+M+A/cT/RO9uw==</DP><DQ>pjma1ljNh2CTTrS8nAsaSJSc1gZD7l33RQRrAgWju7yN/qG2DbzhSZ9X7355uSKA5qK8/Gnz+QnvBn3JwGvE/w==</DQ><InverseQ>3U67bp3lPExfGoiTRvRyHhNtyJs6hAq/Uj7wSHKLHNoLG20kwZux8BwZKpPBBA0bQjkLUiRv9PYs18El/45/wA==</InverseQ><D>bPVOg5FMjWRBhmTbQ3ZWGkGLjRR9KEFDiTJXHs6DWjDgnZceWe9KB6KoJ0Vzkbs/Ovdcr56qBZxC2g6gTS5ALvogBYH2PrUftr4flh/z4qgOrAYCQkTecfHAGIGEldEeF1FItMbqmQa6WzVPVp4tn/+q3PAVmZqrs6/X9EARH10=</D></RSAKeyValue>", sn.RSA.ToXmlString (true), "buffer.RSA");
+                       Assert.AreEqual (testPublicKey, sn.PublicKey, "buffer.PublicKey");
+                       Assert.AreEqual (testPublicKeyToken, sn.PublicKeyToken, "buffer.PublicKeyToken");
                }
 
                [Test]
@@ -122,9 +122,9 @@ namespace MonoTests.Mono.Security {
                {
                        StrongName sn1 = new StrongName (test);
                        StrongName sn2 = new StrongName (sn1.RSA);
-                       AssertEquals ("key.RSA", sn1.RSA.ToXmlString (true), sn2.RSA.ToXmlString (true));
-                       AssertEquals ("key.PublicKey", sn1.PublicKey, sn2.PublicKey);
-                       AssertEquals ("key.PublicKeyToken", sn1.PublicKeyToken, sn2.PublicKeyToken);
+                       Assert.AreEqual (sn1.RSA.ToXmlString (true), sn2.RSA.ToXmlString (true), "key.RSA");
+                       Assert.AreEqual (sn1.PublicKey, sn2.PublicKey, "key.PublicKey");
+                       Assert.AreEqual (sn1.PublicKeyToken, sn2.PublicKeyToken, "key.PublicKeyToken");
                }
 
                string Signed;
@@ -820,28 +820,28 @@ namespace MonoTests.Mono.Security {
                {
                        // compare that both hellosigned and hellodelay are the same file expect for signature
                        byte[] s = sn.Hash (Signed);
-                       AssertNotNull ("Hash/Signed", s);
+                       Assert.IsNotNull (s, "Hash/Signed");
                        byte[] d = sn.Hash (Delay);
-                       AssertNotNull ("Hash/Delay", d);
+                       Assert.IsNotNull (d, "Hash/Delay");
                        // are they the same
-                       AssertEquals ("Hash/Compare", s, d);
+                       Assert.AreEqual (s, d, "Hash/Compare");
                        // are they the same as GetHashFromAssemblyFile
                        byte[] knownHash = { 0x7D, 0xF7, 0x1D, 0xD4, 0x24, 0x22, 0xEA, 0xAB, 0xD2, 0x91, 0xCD, 0xAB, 0x1A, 0x55, 0x6A, 0x42, 0x05, 0xBA, 0x6E, 0x7B };
-                       AssertEquals ("Hash/GetHashFromAssemblyFile", knownHash, s);
+                       Assert.AreEqual (knownHash, s, "Hash/GetHashFromAssemblyFile");
                }
 
                [Test]
                public void VerifyValid () 
                {
                        // verify that hellosigned.exe is valid
-                       Assert ("Verify/Valid", sn.Verify (Signed));
+                       Assert.IsTrue (sn.Verify (Signed), "Verify/Valid");
                }
 
                [Test]
                public void VerifyInvalid () 
                {
                        // verify that hellodelay.exe isn't valid
-                       Assert ("Verify/Invalid", !sn.Verify (Delay));
+                       Assert.IsTrue (!sn.Verify (Delay), "Verify/Invalid");
                }
 
                [Test]
@@ -849,7 +849,7 @@ namespace MonoTests.Mono.Security {
                {
                        Stream signed = new MemoryStream (signedData);
                        // verify that hellosigned.exe is valid
-                       Assert ("Verify/Valid", sn.Verify (signed));
+                       Assert.IsTrue (sn.Verify (signed), "Verify/Valid");
                }
 
                [Test]
@@ -857,25 +857,25 @@ namespace MonoTests.Mono.Security {
                {
                        Stream delay = new MemoryStream (delayData);
                        // verify that hellodelay.exe isn't valid
-                       Assert ("Verify/Invalid", !sn.Verify (delay));
+                       Assert.IsTrue (!sn.Verify (delay), "Verify/Invalid");
                }
 
                [Test]
                public void Sign () 
                {
                        // sign the (invalid) hellodelay.exe
-                       Assert ("Sign", sn.Sign (Delay));
+                       Assert.IsTrue (sn.Sign (Delay), "Sign");
                        // and verify it's now valid
-                       Assert ("Sign/Verify", sn.Verify (Delay));
+                       Assert.IsTrue (sn.Verify (Delay), "Sign/Verify");
                }
 
                [Test]
                public void ReSign () 
                {
                        // resign the (already valid) hellosigned.exe
-                       Assert ("ReSign", sn.Sign (Signed));
+                       Assert.IsTrue (sn.Sign (Signed), "ReSign");
                        // and verify it's still valid
-                       Assert ("ReSign/Verify", sn.Verify (Signed));
+                       Assert.IsTrue (sn.Verify (Signed), "ReSign/Verify");
                }
                
                [Test]
@@ -907,7 +907,7 @@ namespace MonoTests.Mono.Security {
                {
                        byte[] ecma = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; 
                        sn = new StrongName (ecma);
-                       Assert ("CanSign", !sn.CanSign);
+                       Assert.IsTrue (!sn.CanSign, "CanSign");
                }
 
                [Test]
index 8673fc48022bf86c218f9fbb97b6079e121206c1..66c126fd520bd656e795eea1109cf12028a27684 100644 (file)
@@ -447,7 +447,7 @@ namespace MonoTests.System.Data
                {
                        DataTable dt = DataProvider.CreateParentDataTable();
                        dt.Constraints.Add("UniqueConstraint",dt.Columns["ParentId"],true);
-                       Assert.AreEqual(1,dt.Constraints.Count,1); 
+                       Assert.AreEqual(1,(double) dt.Constraints.Count,1); 
                        Assert.AreEqual("UniqueConstraint",dt.Constraints[0].ConstraintName,"CN34");                    
                }
                
index 5b2fd8ca9f3d66c97964d7d1ae0b44fc596f32cd..e8487efaf6bc0cae842a9839adafe27c6a84960a 100644 (file)
@@ -41,7 +41,7 @@ using System.Data;
 namespace MonoTests.System.Data
 {
        [TestFixture]
-       public class DataRowTest : Assertion {
+       public class DataRowTest {
                private DataTable table;                                                
                 private DataRow row;    
 
@@ -101,7 +101,7 @@ namespace MonoTests.System.Data
                 private  void GetColumnErrorTest ()
                 {
                         // Print the error of a specified column.
-                        AssertEquals ("#A01", "Some error!", row.GetColumnError (1));
+                        Assert.AreEqual ("Some error!", row.GetColumnError (1), "#A01");
                 }
 
                 private void GetAllErrorsTest ()
@@ -112,7 +112,7 @@ namespace MonoTests.System.Data
                                 colArr = row.GetColumnsInError ();
                                                                                                     
                                 for (int i = 0; i < colArr.Length; i++) {
-                                        AssertEquals ("#A02", table.Columns [1], colArr [i]);
+                                        Assert.AreEqual (table.Columns [1], colArr [i], "#A02");
                                 }
                                 row.ClearErrors ();
                         }
@@ -135,7 +135,7 @@ namespace MonoTests.System.Data
                         int cnt = 1;
                         for (int i = 1; i < table.Rows.Count; i++) {
                                 DataRow r = table.Rows [i];
-                                AssertEquals ("#A03", "Name " + cnt, r ["fName"]);
+                                Assert.AreEqual ("Name " + cnt, r ["fName"], "#A03");
                                 cnt++;
                         }
                                                                                                     
@@ -146,20 +146,20 @@ namespace MonoTests.System.Data
                        rc [2].Delete ();
                                                                                                     
                                                                                                     
-                        AssertEquals ("#A04", "Deleted", rc [0].RowState.ToString ());
-                        AssertEquals ("#A05", "Deleted", rc [2].RowState.ToString ());
+                        Assert.AreEqual ("Deleted", rc [0].RowState.ToString (), "#A04");
+                        Assert.AreEqual ("Deleted", rc [2].RowState.ToString (), "#A05");
                                                                                                     
                                                                                                     
                         // Accept changes
                         table.AcceptChanges ();
-                        AssertEquals ("#A06", "Name 1", (table.Rows [0]) [1]);
+                        Assert.AreEqual ("Name 1", (table.Rows [0]) [1], "#A06");
                         try  {
                                 object o = rc [2];
-                                Fail ("#A07");
+                                Assert.Fail ("#A07");
                         }
                         catch (Exception e) {
                                // Never premise English.
-                                //AssertEquals ("#A08", "There is no row at position 2.", e.Message);
+                                //Assert.AreEqual ("#A08", "There is no row at position 2.", e.Message);
                         }
                 }
 
@@ -179,40 +179,40 @@ namespace MonoTests.System.Data
                                                                                                     
                                 // Stage 1
                                 //Initially: After Add (Row) But Before Accept Changes");
-                                AssertEquals ("#A09", "My FName", row [1, DataRowVersion.Default]);
-                                AssertEquals ("#A10", "LName", row [2, DataRowVersion.Default]);
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Default], "#A09");
+                                Assert.AreEqual ("LName", row [2, DataRowVersion.Default], "#A10");
                                                                                                     
-                                AssertEquals ("#A11", "My FName", row [1, DataRowVersion.Current]);
-                                AssertEquals ("#A12", "LName", row [2, DataRowVersion.Current]);
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Current], "#A11");
+                                Assert.AreEqual ("LName", row [2, DataRowVersion.Current], "#A12");
                                                                                                     
                                 try {
                                       object o = row [1, DataRowVersion.Original];
                                       o = row [1, DataRowVersion.Proposed];
-                                        Fail ("#A13");
+                                        Assert.Fail ("#A13");
                                 }
                                 catch (Exception e) {
                                         if (e.GetType () != typeof (AssertionException)) {
-                                                AssertEquals ("#A14", typeof (VersionNotFoundException), e.GetType ());
+                                                Assert.AreEqual (typeof (VersionNotFoundException), e.GetType (), "#A14");
                                         }
                                 }
                                                                                                     
                                 // Stage 2
                                 //After Accept Changes
                                 table.AcceptChanges ();
-                                AssertEquals ("#A15", "My FName", row [1, DataRowVersion.Default]);
-                                AssertEquals ("#A16", "LName", row [2, DataRowVersion.Default]);
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Default], "#A15");
+                                Assert.AreEqual ("LName", row [2, DataRowVersion.Default], "#A16");
                                                                                                     
                                                                                                     
-                                AssertEquals ("#A17", "My FName", row [1, DataRowVersion.Current]);
-                                AssertEquals ("#A18", "LName", row [2, DataRowVersion.Current]);
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Current], "#A17");
+                                Assert.AreEqual ("LName", row [2, DataRowVersion.Current], "#A18");
                                 
                                try {
                                       object o = row [1, DataRowVersion.Proposed];
-                                        Fail ("#A19");
+                                        Assert.Fail ("#A19");
                                 }
                                 catch (Exception e) {
                                         if (e.GetType () != typeof (AssertionException)) {
-                                                AssertEquals ("#A20", typeof (VersionNotFoundException), e.GetType ());
+                                                Assert.AreEqual (typeof (VersionNotFoundException), e.GetType (), "#A20");
                                         }
                                 }
                                                                                                     
@@ -221,63 +221,64 @@ namespace MonoTests.System.Data
                                 table.Rows [0].BeginEdit ();
                                 table.Rows [0] ["LName"] = "My LName";
                                                                                                     
-                                AssertEquals ("#A21", "My FName", row [1, DataRowVersion.Default]);
-                                AssertEquals ("#A22", "My LName", row [2, DataRowVersion.Default]);
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Default], "#A21");
+                                Assert.AreEqual ("My LName", row [2, DataRowVersion.Default], "#A22");
                                                                                                                                                                                                          
-                                AssertEquals ("#A23", "My FName", row [1, DataRowVersion.Current]);
-                                AssertEquals ("#A24", "LName", row [2, DataRowVersion.Current]);
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Current], "#A23");
+                                Assert.AreEqual ("LName", row [2, DataRowVersion.Current], "#A24");
                                                                                                     
                                                                                                     
-                                AssertEquals ("#A25", "My FName", row [1, DataRowVersion.Original]);                                AssertEquals ("#A26", "LName", row [2, DataRowVersion.Original]);
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Original], "#A25");
+                                Assert.AreEqual ("LName", row [2, DataRowVersion.Original], "#A26");
                                                                                                     
-                                AssertEquals ("#A26", "My FName", row [1, DataRowVersion.Proposed]);
-                               AssertEquals ("#A27", "My LName", row [2, DataRowVersion.Proposed]);                                                                                                    
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Proposed], "#A26");
+                                Assert.AreEqual ("My LName", row [2, DataRowVersion.Proposed], "#A27");                                                                                                    
                                                                                                     
                                                                                                     
                                 // Stage 4
                                 //After Edit sessions
                                 for (int i=0; i < table.Rows.Count;i++)
                                         table.Rows [i].EndEdit ();
-                                AssertEquals ("#A28", "My FName", row [1, DataRowVersion.Default]);
-                                AssertEquals ("#A29", "My LName", row [2, DataRowVersion.Default]);
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Default], "#A28");
+                                Assert.AreEqual ("My LName", row [2, DataRowVersion.Default], "#A29");
                                                                                                                                                                                                          
-                                AssertEquals ("#A30", "My FName", row [1, DataRowVersion.Original]);                                AssertEquals ("#A31", "LName", row [2, DataRowVersion.Original]);
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Original], "#A30");                                Assert.AreEqual ("LName", row [2, DataRowVersion.Original], "#A31");
                                                                                                     
                                                                                                     
-                                AssertEquals ("#A32", "My FName", row [1, DataRowVersion.Current]);
-                                AssertEquals ("#A33", "My LName", row [2, DataRowVersion.Current]);
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Current], "#A32");
+                                Assert.AreEqual ("My LName", row [2, DataRowVersion.Current], "#A33");
                                                                                                     
                                 try {
                                       object o = row [1, DataRowVersion.Proposed];
-                                        Fail ("#A34");
+                                        Assert.Fail ("#A34");
                                 }
                                 catch (Exception e) {
                                         if (e.GetType ()!=typeof (AssertionException)) {
-                                                AssertEquals ("#A35", typeof (VersionNotFoundException), e.GetType ());
+                                                Assert.AreEqual (typeof (VersionNotFoundException), e.GetType (), "#A35");
                                         }
                                 }
                                                                                                     
                                 //Stage 5
                                 //After Accept Changes
                                table.AcceptChanges ();
-                               AssertEquals ("#A36", "My FName", row [1, DataRowVersion.Default]);
-                                AssertEquals ("#A37", "My LName", row [2, DataRowVersion.Default]);
+                               Assert.AreEqual ("My FName", row [1, DataRowVersion.Default], "#A36");
+                                Assert.AreEqual ("My LName", row [2, DataRowVersion.Default], "#A37");
                                                                                                     
                                                                                                     
-                                AssertEquals ("#A38", "My FName", row [1, DataRowVersion.Original]);                                AssertEquals ("#A39", "My LName", row [2, DataRowVersion.Original]);                                                                                                    
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Original], "#A38");                                Assert.AreEqual (row [2, DataRowVersion.Original], "#A39", "My LName");                                                                                                    
                                                                                                     
-                                AssertEquals ("#A40", "My FName", row [1, DataRowVersion.Current]);
-                                AssertEquals ("#A41", "My LName", row [2, DataRowVersion.Current]);
+                                Assert.AreEqual ("My FName", row [1, DataRowVersion.Current], "#A40");
+                                Assert.AreEqual ("My LName", row [2, DataRowVersion.Current], "#A41");
                                                                                                     
                                                                                                     
                                 try {
                                       object o = row [1, DataRowVersion.Proposed];
-                                        Fail ("#A42");
+                                        Assert.Fail ("#A42");
                                 }
                                 catch (Exception e) {
                                                 if (e.GetType () != typeof (AssertionException)) {
-                                                        AssertEquals ("#A43", typeof (VersionNotFoundException),
-                                                                e.GetType ());
+                                                        Assert.AreEqual (typeof (VersionNotFoundException), e.GetType (),
+                                                                "#A43");
                                                 }
                                         }
                                                                                                     
@@ -328,22 +329,22 @@ namespace MonoTests.System.Data
                                                                                                     
                         rowC.SetParentRow (table.Rows [0], dr);
                                                                                                     
-                        AssertEquals ("#PRT-01", table.Rows [0], (tableC.Rows [0]).GetParentRow (dr));
-                       AssertEquals ("#PRT-02", tableC.Rows [0], (table.Rows [0]).GetChildRows (dr) [0]);
+                        Assert.AreEqual (table.Rows [0], (tableC.Rows [0]).GetParentRow (dr), "#PRT-01");
+                       Assert.AreEqual (tableC.Rows [0], (table.Rows [0]).GetChildRows (dr) [0], "#PRT-02");
 
                         ds.Relations.Clear ();
                         dr = new DataRelation ("PO", table.Columns ["Id"], tableC.Columns ["Id"], false);
                         ds.Relations.Add (dr);
                         rowC.SetParentRow (table.Rows [0], dr);
-                        AssertEquals ("#PRT-03", table.Rows [0], (tableC.Rows [0]).GetParentRow (dr));
-                       AssertEquals ("#PRT-04", tableC.Rows [0], (table.Rows [0]).GetChildRows (dr) [0]);
+                        Assert.AreEqual (table.Rows [0], (tableC.Rows [0]).GetParentRow (dr), "#PRT-03");
+                       Assert.AreEqual (tableC.Rows [0], (table.Rows [0]).GetChildRows (dr) [0], "#PRT-04");
 
                         ds.Relations.Clear ();
                         dr = new DataRelation ("PO", table.Columns ["Id"], tableC.Columns ["Id"], false);
                         tableC.ParentRelations.Add (dr);
                         rowC.SetParentRow (table.Rows [0]);
-                        AssertEquals ("#PRT-05", table.Rows [0], (tableC.Rows [0]).GetParentRow (dr));
-                        AssertEquals ("#PRT-06", tableC.Rows [0], (table.Rows [0]).GetChildRows (dr) [0]);
+                        Assert.AreEqual (table.Rows [0], (tableC.Rows [0]).GetParentRow (dr), "#PRT-05");
+                        Assert.AreEqual (tableC.Rows [0], (table.Rows [0]).GetChildRows (dr) [0], "#PRT-06");
                                                
                 } 
 
@@ -377,8 +378,8 @@ namespace MonoTests.System.Data
                         rowC.SetParentRow (row, dr);
                         DataRow [] rows = rowC.GetParentRows (dr);
 
-                        AssertEquals ("#A49", 1, rows.Length);
-                        AssertEquals ("#A50", tableP.Rows [0], rows [0]);
+                        Assert.AreEqual (1, rows.Length, "#A49");
+                        Assert.AreEqual (tableP.Rows [0], rows [0], "#A50");
 
                         try{
                                 rows = row.GetParentRows (dr);
@@ -386,10 +387,10 @@ namespace MonoTests.System.Data
                                 //Test done
                                 return ;
                         }catch(Exception e){
-                                Fail("#A51, InvalidConstraintException expected, got : " + e);
+                                Assert.Fail("#A51, InvalidConstraintException expected, got : " + e);
                         }
                         
-                        Fail("#A52, InvalidConstraintException expected but got none.");
+                        Assert.Fail("#A52, InvalidConstraintException expected but got none.");
                 }
 
                 [Test]
@@ -434,8 +435,8 @@ namespace MonoTests.System.Data
                                                                                                     
                         DataRow [] rows = (table.Rows [0]).GetChildRows (dr);
 
-                        AssertEquals ("#A45", 1, rows.Length);
-                        AssertEquals ("#A46", tableC.Rows [0], rows [0]);
+                        Assert.AreEqual (1, rows.Length, "#A45");
+                        Assert.AreEqual (tableC.Rows [0], rows [0], "#A46");
                         
                 } 
 
@@ -469,8 +470,8 @@ namespace MonoTests.System.Data
                         rowC.SetParentRow (row, dr);
                         DataRow [] rows = row.GetChildRows (dr);
                         
-                        AssertEquals ("#A47", 1, rows.Length);
-                        AssertEquals ("#A48", tableC.Rows [0], rows [0]);
+                        Assert.AreEqual (1, rows.Length, "#A47");
+                        Assert.AreEqual (tableC.Rows [0], rows [0], "#A48");
 
                         try{
                             rows = rowC.GetChildRows (dr);
@@ -478,10 +479,10 @@ namespace MonoTests.System.Data
                             //Test done
                             return ;
                         }catch(Exception e){
-                            Fail("#A53, InvalidConstraintException expected, got : " + e);
+                            Assert.Fail("#A53, InvalidConstraintException expected, got : " + e);
                         }
                         
-                        Fail("#A54, InvalidConstraintException expected but got none.");
+                        Assert.Fail("#A54, InvalidConstraintException expected but got none.");
                 }
 
                 [Category ("NotWorking")] //Mismatch in Exception namespace/class reference
@@ -528,35 +529,35 @@ namespace MonoTests.System.Data
                                 //Test Done
                                 return ;
                             }catch (Exception e){
-                                Fail ("#A55, VersionNotFoundException expected, got : " + e);
+                                Assert.Fail ("#A55, VersionNotFoundException expected, got : " + e);
                             }
-                            Fail ("#A56, VersionNotFoundException expected but got none.");
+                            Assert.Fail ("#A56, VersionNotFoundException expected but got none.");
                         }catch (Exception e){
-                            Fail ("#A57, VersionNotFoundException expected, got : " + e);
+                            Assert.Fail ("#A57, VersionNotFoundException expected, got : " + e);
                         }
                         
-                        Fail("#A58, VersionNotFoundException expected but got none.");
+                        Assert.Fail("#A58, VersionNotFoundException expected but got none.");
                 }
 
                // tests item at row, column in table to be DBNull.Value
                private void DBNullTest (string message, DataTable dt, int row, int column) 
                {
                        object val = dt.Rows[row].ItemArray[column];
-                       AssertEquals(message, DBNull.Value, val);
+                       Assert.AreEqual(DBNull.Value, val, message);
                }
 
                // tests item at row, column in table to be null
                private void NullTest (string message, DataTable dt, int row, int column) 
                {
                        object val = dt.Rows[row].ItemArray[column];
-                       AssertEquals(message, null, val);
+                       Assert.AreEqual(null, val, message);
                }
 
                // tests item at row, column in table to be 
                private void ValueTest (string message, DataTable dt, int row, int column, object value) 
                {
                        object val = dt.Rows[row].ItemArray[column];
-                       AssertEquals(message, value, val);
+                       Assert.AreEqual(value, val, message);
                }
 
                // test set null, DBNull.Value, and ItemArray short count
@@ -588,7 +589,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e1) {
-                               Fail("DR1: Exception Caught: " + e1);
+                               Assert.Fail("DR1: Exception Caught: " + e1);
                        }
                        
                        table.Rows.Add(row);
@@ -606,7 +607,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e2) {
-                               Fail("DR2: Exception Caught: " + e2);
+                               Assert.Fail("DR2: Exception Caught: " + e2);
                        }
                        
                        table.Rows.Add(row);
@@ -624,7 +625,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e3) {
-                               Fail("DR3: Exception Caught: " + e3);
+                               Assert.Fail("DR3: Exception Caught: " + e3);
                        }
                        
                        table.Rows.Add(row);
@@ -646,7 +647,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e3) {
-                               Fail("DR4: Exception Caught: " + e3);
+                               Assert.Fail("DR4: Exception Caught: " + e3);
                        }
                        
                        table.Rows.Add(row);
@@ -698,7 +699,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e1) {
-                               Fail("DR17: Exception Caught: " + e1);
+                               Assert.Fail("DR17: Exception Caught: " + e1);
                        }
                        
                        table.Rows.Add(row);
@@ -715,7 +716,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e2) {
-                               Fail("DR18: Exception Caught: " + e2);
+                               Assert.Fail("DR18: Exception Caught: " + e2);
                        }
                        
                        table.Rows.Add(row);
@@ -733,7 +734,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e3) {
-                               Fail("DR19: Exception Caught: " + e3);
+                               Assert.Fail("DR19: Exception Caught: " + e3);
                        }
                        
                        table.Rows.Add(row);
@@ -753,7 +754,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e3) {
-                               Fail("DR20: Exception Caught: " + e3);
+                               Assert.Fail("DR20: Exception Caught: " + e3);
                        }
                        
                        table.Rows.Add(row);
@@ -802,7 +803,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e1) {
-                               Fail("DR28:  Exception Caught: " + e1);
+                               Assert.Fail("DR28:  Exception Caught: " + e1);
                        }
                        
                        table.Rows.Add(row);
@@ -819,7 +820,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e2) {
-                               Fail("DR29:  Exception Caught: " + e2);
+                               Assert.Fail("DR29:  Exception Caught: " + e2);
                        }
                        
                        table.Rows.Add(row);
@@ -836,7 +837,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e2) {
-                               Fail("DR30: Exception Caught: " + e2);
+                               Assert.Fail("DR30: Exception Caught: " + e2);
                        }
                        
                        table.Rows.Add(row);
@@ -853,7 +854,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e2) {
-                               Fail("DR31: Exception Caught: " + e2);
+                               Assert.Fail("DR31: Exception Caught: " + e2);
                        }
                        
                        table.Rows.Add(row);
@@ -872,7 +873,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e3) {
-                               Fail("DR32: Exception Caught: " + e3);
+                               Assert.Fail("DR32: Exception Caught: " + e3);
                        }
                        
                        table.Rows.Add(row);
@@ -889,7 +890,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e2) {
-                               Fail("DR48: Exception Caught: " + e2);
+                               Assert.Fail("DR48: Exception Caught: " + e2);
                        }
                        
                        table.Rows.Add(row);
@@ -909,7 +910,7 @@ namespace MonoTests.System.Data
                                row.ItemArray = obj;
                        }
                        catch(Exception e3) {
-                               Fail("DR33: Exception Caught: " + e3);
+                               Assert.Fail("DR33: Exception Caught: " + e3);
                        }
                        
                        table.Rows.Add(row);
@@ -986,7 +987,7 @@ namespace MonoTests.System.Data
                        DataRow childRow = child.Rows.Add(new object[] { id });
                        if (parentRow == childRow.GetParentRow(relateParentChild)) {
                            foreach(DataColumn dc in parent.Columns)
-                               AssertEquals(100,parentRow[dc]);
+                               Assert.AreEqual(100,parentRow[dc]);
                            
                        }
                                        
@@ -1002,9 +1003,9 @@ namespace MonoTests.System.Data
                        dt.Rows.Add ((new object [] {"val"}));
 
                        DataRow dr = dt.NewRow ();
-                       AssertEquals (DataRowState.Detached, dr.RowState);
+                       Assert.AreEqual (DataRowState.Detached, dr.RowState);
                        dr.CancelEdit ();
-                       AssertEquals (DataRowState.Detached, dr.RowState);
+                       Assert.AreEqual (DataRowState.Detached, dr.RowState);
                        object o = dr ["col"];
                }
 
@@ -1056,20 +1057,20 @@ namespace MonoTests.System.Data
                        parent2.Rows.Add(parent2Row);
 
                        childRow1.SetParentRow(parent1Row);
-                       AssertEquals ("p1c1", childRow1[childColumn1]);
-                       AssertEquals (DBNull.Value, childRow1[childColumn2]);
+                       Assert.AreEqual ("p1c1", childRow1[childColumn1]);
+                       Assert.AreEqual (DBNull.Value, childRow1[childColumn2]);
 
                        childRow1.SetParentRow(parent2Row);
-                       AssertEquals ("p1c1", childRow1[childColumn1]);
-                       AssertEquals ("p2c2", childRow1[childColumn2]);
+                       Assert.AreEqual ("p1c1", childRow1[childColumn1]);
+                       Assert.AreEqual ("p2c2", childRow1[childColumn2]);
 
                        childRow1.SetParentRow(null);
-                       AssertEquals (DBNull.Value, childRow1[childColumn1]);
-                       AssertEquals (DBNull.Value, childRow1[childColumn2]);
+                       Assert.AreEqual (DBNull.Value, childRow1[childColumn1]);
+                       Assert.AreEqual (DBNull.Value, childRow1[childColumn2]);
 
                        childRow1.SetParentRow(parent2Row);
-                       AssertEquals (DBNull.Value, childRow1[childColumn1]);
-                       AssertEquals ("p2c2", childRow1[childColumn2]);
+                       Assert.AreEqual (DBNull.Value, childRow1[childColumn1]);
+                       Assert.AreEqual ("p2c2", childRow1[childColumn2]);
                }
 
                [Test]
@@ -1108,29 +1109,29 @@ namespace MonoTests.System.Data
 
 
                        childRow1.SetParentRow (null, relation2);
-                       AssertEquals (DBNull.Value, childRow1[childColumn1]);
-                       AssertEquals (DBNull.Value, childRow1[childColumn2]);
+                       Assert.AreEqual (DBNull.Value, childRow1[childColumn1]);
+                       Assert.AreEqual (DBNull.Value, childRow1[childColumn2]);
 
                        try {
                                childRow1.SetParentRow(parent1Row, relation2);
-                               Fail ("Must throw InvalidConstaintException");
+                               Assert.Fail ("Must throw InvalidConstaintException");
                        } catch (InvalidConstraintException e) {
                        }
-                       AssertEquals (DBNull.Value, childRow1[childColumn1]);
-                       AssertEquals (DBNull.Value, childRow1[childColumn2]);
+                       Assert.AreEqual (DBNull.Value, childRow1[childColumn1]);
+                       Assert.AreEqual (DBNull.Value, childRow1[childColumn2]);
 
                        childRow1.SetParentRow(parent1Row, relation1);
-                       AssertEquals ("p1c1", childRow1[childColumn1]);
-                       AssertEquals (DBNull.Value, childRow1[childColumn2]);
+                       Assert.AreEqual ("p1c1", childRow1[childColumn1]);
+                       Assert.AreEqual (DBNull.Value, childRow1[childColumn2]);
 
 
                        childRow1.SetParentRow (null, relation2);
-                       AssertEquals ("p1c1", childRow1[childColumn1]);
-                       AssertEquals (DBNull.Value, childRow1[childColumn2]);
+                       Assert.AreEqual ("p1c1", childRow1[childColumn1]);
+                       Assert.AreEqual (DBNull.Value, childRow1[childColumn2]);
 
                        childRow1.SetParentRow (null, relation1);
-                       AssertEquals (DBNull.Value, childRow1[childColumn1]);
-                       AssertEquals (DBNull.Value, childRow1[childColumn2]);
+                       Assert.AreEqual (DBNull.Value, childRow1[childColumn1]);
+                       Assert.AreEqual (DBNull.Value, childRow1[childColumn2]);
                }
 
                [Test]
@@ -1161,8 +1162,8 @@ namespace MonoTests.System.Data
                        parent2.Rows.Add(parentRow);
 
                        childRow.SetParentRow(parentRow);
-                       AssertEquals (DBNull.Value, childRow[childColumn1]);
-                       AssertEquals ("value", childRow[childColumn2]);
+                       Assert.AreEqual (DBNull.Value, childRow[childColumn1]);
+                       Assert.AreEqual ("value", childRow[childColumn2]);
                }
 
        }
index 51885f37bcb0a2cc4f5e2cd883495bc9b3166c38..60dbb9d39339dc98b2a526703428273d5b7a10e9 100644 (file)
@@ -36,7 +36,7 @@ using System.ComponentModel;
 namespace MonoTests.System.Data
 {
        [TestFixture]
-       public class DataRowViewTest : Assertion
+       public class DataRowViewTest 
        {
                private DataView CreateTestView ()
                {
@@ -96,8 +96,8 @@ namespace MonoTests.System.Data
                        DataView dv = new DataView (dt1);
                        DataRowView dvr = dv [0];
                        DataView v = dvr.CreateChildView (dr);
-                       AssertEquals ("RowFilter", "", v.RowFilter);
-                       AssertEquals ("Sort", "", v.Sort);
+                       Assert.AreEqual ("", v.RowFilter, "RowFilter");
+                       Assert.AreEqual ("", v.Sort, "Sort");
                }
 
                [Test]
@@ -110,12 +110,12 @@ namespace MonoTests.System.Data
                        DataView dv = new DataView (dt);
                        DataRowView drv = dv [0];
                        dt.Rows [0].BeginEdit ();
-                       AssertEquals ("DataView.Item", true, drv.IsEdit);
+                       Assert.AreEqual (true, drv.IsEdit, "DataView.Item");
 
                        drv = dv.AddNew ();
                        drv.Row ["col"] = "test";
                        drv.Row.CancelEdit ();
-                       AssertEquals ("AddNew", false, drv.IsEdit);
+                       Assert.AreEqual (false, drv.IsEdit, "AddNew");
                }
 
                [Test]
@@ -127,7 +127,7 @@ namespace MonoTests.System.Data
                        DataView dv = new DataView (dt);
                        DataRowView drv = dv [0];
                        dt.Rows [0].BeginEdit ();
-                       AssertEquals ("DataView.Item", "val", drv ["col"]);
+                       Assert.AreEqual ("val", drv ["col"], "DataView.Item");
                }
 
                [Test]
@@ -153,18 +153,18 @@ namespace MonoTests.System.Data
                        dt.Rows.Add (new object [] {1});
                        DataView dv = new DataView (dt);
                        DataRowView drv = dv.AddNew ();
-                       AssertEquals (DataRowVersion.Current, drv.RowVersion);
-                       AssertEquals (DataRowVersion.Current, dv [0].RowVersion);
+                       Assert.AreEqual (DataRowVersion.Current, drv.RowVersion);
+                       Assert.AreEqual (DataRowVersion.Current, dv [0].RowVersion);
                        drv ["col"] = "mod";
-                       AssertEquals (DataRowVersion.Current, drv.RowVersion);
-                       AssertEquals (DataRowVersion.Current, dv [0].RowVersion);
+                       Assert.AreEqual (DataRowVersion.Current, drv.RowVersion);
+                       Assert.AreEqual (DataRowVersion.Current, dv [0].RowVersion);
                        dt.AcceptChanges ();
-                       AssertEquals (DataRowVersion.Current, drv.RowVersion);
-                       AssertEquals (DataRowVersion.Current, dv [0].RowVersion);
+                       Assert.AreEqual (DataRowVersion.Current, drv.RowVersion);
+                       Assert.AreEqual (DataRowVersion.Current, dv [0].RowVersion);
                        drv.EndEdit ();
                        dv [0].EndEdit ();
-                       AssertEquals (DataRowVersion.Current, drv.RowVersion);
-                       AssertEquals (DataRowVersion.Current, dv [0].RowVersion);
+                       Assert.AreEqual (DataRowVersion.Current, drv.RowVersion);
+                       Assert.AreEqual (DataRowVersion.Current, dv [0].RowVersion);
                }
        }
 }
index 05d0eddc7fba37c4b61b41c75063272fec799956..bf34b01d1c61a9fe7921050a5e0f168b7e3430ba 100644 (file)
@@ -37,7 +37,7 @@ namespace MonoTests.System.Data
 {
 
        [TestFixture]
-       public class DataTableCollectionTest : Assertion {
+       public class DataTableCollectionTest {
                // common variables here
                private DataSet [] _dataset;
                private DataTable [] _tables;
@@ -76,11 +76,11 @@ namespace MonoTests.System.Data
                        
                        foreach( DataTable table in tbcol )
                        {
-                               AssertEquals("test#1",_tables[i].TableName,table.TableName);
+                               Assert.AreEqual(_tables[i].TableName,table.TableName,"test#1");
                                j=0;
                                foreach( DataColumn column in table.Columns )
                                {
-                                       AssertEquals("test#2",_tables[i].Columns[j].ColumnName,column.ColumnName);
+                                       Assert.AreEqual(_tables[i].Columns[j].ColumnName,column.ColumnName,"test#2");
                                        j++;
                                }
                                i++;
@@ -90,11 +90,11 @@ namespace MonoTests.System.Data
                        i=0;
                        foreach( DataTable table in tbcol )
                        {
-                               AssertEquals("test#3",_tables[i].TableName,table.TableName);
+                               Assert.AreEqual(_tables[i].TableName,table.TableName,"test#3");
                                j=0;
                                foreach( DataColumn column in table.Columns )
                                {
-                                       AssertEquals("test#4",_tables[i].Columns[j].ColumnName,column.ColumnName);
+                                       Assert.AreEqual(_tables[i].Columns[j].ColumnName,column.ColumnName,"test#4");
                                        j++;
                                }
                                i++;
@@ -143,9 +143,9 @@ namespace MonoTests.System.Data
                {
                        DataTableCollection tbcol = _dataset[0].Tables;
                        tbcol.Add(_tables[0]);
-                       AssertEquals("test#1",1, tbcol.Count);
+                       Assert.AreEqual(1,tbcol.Count, "test#1");
                        tbcol.Add(_tables[1]);
-                       AssertEquals("test#2",2, tbcol.Count);
+                       Assert.AreEqual(2,tbcol.Count, "test#2");
                }
                
                [Test]
@@ -159,11 +159,11 @@ namespace MonoTests.System.Data
                        i=0;
                        foreach( DataTable table in tbcol )
                        {
-                               AssertEquals("test#1",_tables[i].TableName,table.TableName);
+                               Assert.AreEqual(_tables[i].TableName,table.TableName,"test#1");
                                j=0;
                                foreach( DataColumn column in table.Columns )
                                {
-                                       AssertEquals("test#2",_tables[i].Columns[j].ColumnName,column.ColumnName);
+                                       Assert.AreEqual(_tables[i].Columns[j].ColumnName,column.ColumnName,"test#2");
                                        j++;
                                }
                                i++;
@@ -179,11 +179,11 @@ namespace MonoTests.System.Data
                        tbcol.AddRange(_tables);
                        DataTable tbl = null;
                        /* checking for a recently input table, expecting true */
-                       AssertEquals("test#1",true,tbcol.CanRemove(_tables[0]));
+                       Assert.AreEqual(true,tbcol.CanRemove(_tables[0]),"test#1");
                        /* trying to check with a null reference, expecting false */
-                       AssertEquals("test#2",false,tbcol.CanRemove(tbl));
+                       Assert.AreEqual(false,tbcol.CanRemove(tbl),"test#2");
                        /* trying to check with a table that does not exist in collection, expecting false */
-                       AssertEquals("test#3",false,tbcol.CanRemove(new DataTable("newTable")));
+                       Assert.AreEqual(false,tbcol.CanRemove(new DataTable("newTable")),"test#3");
                }
                
                [Test]
@@ -197,27 +197,27 @@ namespace MonoTests.System.Data
                        /* removing a recently added table */
                        int count = tbcol.Count;
                        tbcol.Remove(_tables[0]);
-                       AssertEquals("test#1",count-1,tbcol.Count);
+                       Assert.AreEqual(count-1,tbcol.Count,"test#1");
                        DataTable tbl = null;
                        /* removing a null reference. must generate an Exception */
                        try
                        {
                                tbcol.Remove(tbl);
-                               Fail("Err:: tbcol.Rmove(null) must fail");
+                               Assert.Fail("Err:: tbcol.Rmove(null) must fail");
                        }
                        catch(Exception e)
                        {
-                               AssertEquals ("test#2", typeof (ArgumentNullException), e.GetType());
+                               Assert.AreEqual (typeof (ArgumentNullException), e.GetType(), "test#2");
                        }
                        /* removing a table that is not there in collection */
                        try
                        {
                                tbcol.Remove(new DataTable("newTable"));
-                               Fail("Err:: cannot remove a table that is not there in collection");
+                               Assert.Fail("Err:: cannot remove a table that is not there in collection");
                        }
                        catch(Exception e)
                        {
-                               AssertEquals ("test#3", typeof (ArgumentException), e.GetType());
+                               Assert.AreEqual (typeof (ArgumentException), e.GetType(), "test#3");
                        }
                        
                }
@@ -227,11 +227,11 @@ namespace MonoTests.System.Data
                        DataTableCollection tbcol = _dataset[0].Tables;
                        tbcol.Add(_tables[0]);
                        tbcol.Clear();
-                       AssertEquals("Test#1",0,tbcol.Count);
+                       Assert.AreEqual(0,tbcol.Count,"Test#1");
                        
                        tbcol.AddRange(new DataTable[] {_tables[0],_tables[1]});
                        tbcol.Clear();
-                       AssertEquals("Test#2",0,tbcol.Count);
+                       Assert.AreEqual(0,tbcol.Count,"Test#2");
                }
                [Test]
                public void Contains()
@@ -242,11 +242,11 @@ namespace MonoTests.System.Data
                        tbcol.AddRange(_tables);
                        string tblname = "";
                        /* checking for a recently input table, expecting true */
-                       AssertEquals("test#1",true,tbcol.Contains(_tables[0].TableName));
+                       Assert.AreEqual(true,tbcol.Contains(_tables[0].TableName),"test#1");
                        /* trying to check with a empty string, expecting false */
-                       AssertEquals("test#2",false,tbcol.Contains(tblname));
+                       Assert.AreEqual(false,tbcol.Contains(tblname),"test#2");
                        /* trying to check for a table that donot exist, expecting false */
-                       AssertEquals("test#3",false,tbcol.Contains("InvalidTableName"));
+                       Assert.AreEqual(false,tbcol.Contains("InvalidTableName"),"test#3");
                }
                
                [Test]
@@ -261,21 +261,21 @@ namespace MonoTests.System.Data
                        DataTable [] array = new DataTable[4];
                        /* copying to the beginning of the array */
                        tbcol.CopyTo(array,0);
-                       AssertEquals ("test#01", 4, array.Length);
-                       AssertEquals ("test#02", "Table1", array[0].TableName);
-                       AssertEquals ("test#03", "Table2", array[1].TableName);
-                       AssertEquals ("test#04", "Table3", array[2].TableName);
-                       AssertEquals ("test#05", "Table4", array[3].TableName);
+                       Assert.AreEqual (4, array.Length, "test#01");
+                       Assert.AreEqual ("Table1", array[0].TableName, "test#02");
+                       Assert.AreEqual ("Table2", array[1].TableName, "test#03");
+                       Assert.AreEqual ("Table3", array[2].TableName, "test#04");
+                       Assert.AreEqual ("Table4", array[3].TableName, "test#05");
 
                        /* copying with in a array */
                        DataTable [] array1 = new DataTable[6];
                        tbcol.CopyTo(array1,2);
-                       AssertEquals("test#06",null,array1[0]);
-                       AssertEquals("test#07",null,array1[1]);
-                       AssertEquals("test#08","Table1",array1[2].TableName);
-                       AssertEquals("test#09","Table2",array1[3].TableName);
-                       AssertEquals("test#10","Table3",array1[4].TableName);
-                       AssertEquals("test#11","Table4",array1[5].TableName);                   
+                       Assert.AreEqual(null,array1[0],"test#06");
+                       Assert.AreEqual(null,array1[1],"test#07");
+                       Assert.AreEqual("Table1",array1[2].TableName,"test#08");
+                       Assert.AreEqual("Table2",array1[3].TableName,"test#09");
+                       Assert.AreEqual("Table3",array1[4].TableName,"test#10");
+                       Assert.AreEqual("Table4",array1[5].TableName,"test#11");                        
                }
                [Test]
                public void Equals()
@@ -287,16 +287,16 @@ namespace MonoTests.System.Data
                        tbcol2.Add(_tables[1]);
                        tbcol3 = tbcol1;
                        
-                       AssertEquals("test#1",true,tbcol1.Equals(tbcol1));
-                       AssertEquals("test#2",true,tbcol1.Equals(tbcol3));
-                       AssertEquals("test#3",true,tbcol3.Equals(tbcol1));
+                       Assert.AreEqual(true,tbcol1.Equals(tbcol1),"test#1");
+                       Assert.AreEqual(true,tbcol1.Equals(tbcol3),"test#2");
+                       Assert.AreEqual(true,tbcol3.Equals(tbcol1),"test#3");
                        
-                       AssertEquals("test#4",false,tbcol1.Equals(tbcol2));
-                       AssertEquals("test#5",false,tbcol2.Equals(tbcol1));
+                       Assert.AreEqual(false,tbcol1.Equals(tbcol2),"test#4");
+                       Assert.AreEqual(false,tbcol2.Equals(tbcol1),"test#5");
                        
-                       AssertEquals("test#6",true,Object.Equals(tbcol1,tbcol3));
-                       AssertEquals("test#7",true,Object.Equals(tbcol1,tbcol1));
-                       AssertEquals("test#8",false,Object.Equals(tbcol1,tbcol2));
+                       Assert.AreEqual(true,Object.Equals(tbcol1,tbcol3),"test#6");
+                       Assert.AreEqual(true,Object.Equals(tbcol1,tbcol1),"test#7");
+                       Assert.AreEqual(false,Object.Equals(tbcol1,tbcol2),"test#8");
                }
                [Test]
                public void IndexOf()
@@ -306,16 +306,16 @@ namespace MonoTests.System.Data
                        tbcol.Add("table1");
                        tbcol.Add("table2");
                        
-                       AssertEquals("test#1",0,tbcol.IndexOf(_tables[0]));
-                       AssertEquals("test#2",-1,tbcol.IndexOf(_tables[1]));
-                       AssertEquals("test#3",1,tbcol.IndexOf("table1"));
-                       AssertEquals("test#4",2,tbcol.IndexOf("table2"));
+                       Assert.AreEqual(0,tbcol.IndexOf(_tables[0]),"test#1");
+                       Assert.AreEqual(-1,tbcol.IndexOf(_tables[1]),"test#2");
+                       Assert.AreEqual(1,tbcol.IndexOf("table1"),"test#3");
+                       Assert.AreEqual(2,tbcol.IndexOf("table2"),"test#4");
                        
-                       AssertEquals("test#5",0,tbcol.IndexOf(tbcol[0]));
-                       AssertEquals("test#6",1,tbcol.IndexOf(tbcol[1]));
-                       AssertEquals("test#7",-1,tbcol.IndexOf("_noTable_"));
+                       Assert.AreEqual(0,tbcol.IndexOf(tbcol[0]),"test#5");
+                       Assert.AreEqual(1,tbcol.IndexOf(tbcol[1]),"test#6");
+                       Assert.AreEqual(-1,tbcol.IndexOf("_noTable_"),"test#7");
                        DataTable tb = new DataTable("new_table");
-                       AssertEquals("test#8",-1,tbcol.IndexOf(tb));
+                       Assert.AreEqual(-1,tbcol.IndexOf(tb),"test#8");
                        
                }
                [Test]
@@ -328,7 +328,7 @@ namespace MonoTests.System.Data
                        try
                        {
                                tbcol.RemoveAt(-1);
-                               Fail("the index was out of bound: must have failed");
+                               Assert.Fail("the index was out of bound: must have failed");
                        }
                        catch(IndexOutOfRangeException e)
                        {
@@ -336,15 +336,15 @@ namespace MonoTests.System.Data
                        try
                        {
                                tbcol.RemoveAt(101);
-                               Fail("the index was out of bound: must have failed");
+                               Assert.Fail("the index was out of bound: must have failed");
                        }
                        catch(IndexOutOfRangeException e)
                        {
                        }
                        tbcol.RemoveAt (1);
-                       AssertEquals ("test#5", 1, tbcol.Count);
+                       Assert.AreEqual (1, tbcol.Count, "test#5");
                        tbcol.RemoveAt (0);
-                       AssertEquals ("test#6", 0, tbcol.Count);
+                       Assert.AreEqual (0, tbcol.Count, "test#6");
                }
 
                [Test]
@@ -354,46 +354,46 @@ namespace MonoTests.System.Data
                        tbcol.Add("Table1");
                        tbcol.Add("Table2");
                        tbcol.Add("Table3");
-                       AssertEquals("test#1","System.Data.DataTableCollection",tbcol.ToString());
+                       Assert.AreEqual("System.Data.DataTableCollection",tbcol.ToString(),"test#1");
                }
 
                [Test]
                public void TableDataSetNamespaces ()
                {
                        DataTable dt = new DataTable ("dt1");
-                       AssertEquals ("#1-1", String.Empty, dt.Namespace);
-                       AssertNull ("#1-2", dt.DataSet);
+                       Assert.AreEqual (String.Empty, dt.Namespace, "#1-1");
+                       Assert.IsNull (dt.DataSet, "#1-2");
 
                        DataSet ds1 = new DataSet ("ds1");
                        ds1.Tables.Add (dt);
-                       AssertEquals ("#2-1", String.Empty, dt.Namespace);
-                       AssertEquals ("#2-2", ds1, dt.DataSet);
+                       Assert.AreEqual (String.Empty, dt.Namespace, "#2-1");
+                       Assert.AreEqual (ds1, dt.DataSet, "#2-2");
 
                        ds1.Namespace = "ns1";
-                       AssertEquals ("#3", "ns1", dt.Namespace);
+                       Assert.AreEqual ("ns1", dt.Namespace, "#3");
 
                        // back to null again
                        ds1.Tables.Remove (dt);
-                       AssertEquals ("#4-1", String.Empty, dt.Namespace);
-                       AssertNull ("#4-2", dt.DataSet);
+                       Assert.AreEqual (String.Empty, dt.Namespace, "#4-1");
+                       Assert.IsNull (dt.DataSet, "#4-2");
 
                        // This table is being added to _already namespaced_
                        // dataset.
                        dt = new DataTable ("dt2");
 
                        ds1.Tables.Add (dt);
-                       AssertEquals ("#5-1", "ns1", dt.Namespace);
-                       AssertEquals ("#5-2", ds1, dt.DataSet);
+                       Assert.AreEqual ("ns1", dt.Namespace, "#5-1");
+                       Assert.AreEqual (ds1, dt.DataSet, "#5-2");
 
                        ds1.Tables.Remove (dt);
-                       AssertEquals ("#6-1", String.Empty, dt.Namespace);
-                       AssertNull ("#6-2", dt.DataSet);
+                       Assert.AreEqual (String.Empty, dt.Namespace, "#6-1");
+                       Assert.IsNull (dt.DataSet, "#6-2");
 
                        DataSet ds2 = new DataSet ("ds2");
                        ds2.Namespace = "ns2";
                        ds2.Tables.Add (dt);
-                       AssertEquals ("#7-1", "ns2", dt.Namespace);
-                       AssertEquals ("#7-2", ds2, dt.DataSet);
+                       Assert.AreEqual ("ns2", dt.Namespace, "#7-1");
+                       Assert.AreEqual (ds2, dt.DataSet, "#7-2");
                }
        }
 }
index 57b5eb30846c9f6fddbfbce275d26caa6ad3bf71..392f9b0d4f4e28b48cfa26448425de1e06edbe34 100644 (file)
@@ -36,7 +36,7 @@ using System.ComponentModel;
 namespace MonoTests.System.Data
 {
        [TestFixture]
-       public class DataViewManagerTest : Assertion
+       public class DataViewManagerTest 
        {
                [Test]
                public void Ctor ()
@@ -46,40 +46,40 @@ namespace MonoTests.System.Data
                        string deleted = @"<DataViewSettingCollectionString><table2-1 Sort="""" RowFilter="""" RowStateFilter=""Deleted""/></DataViewSettingCollectionString>";
 
                        DataViewManager m = new DataViewManager (null);
-                       AssertNull (m.DataSet);
-                       AssertEquals ("", m.DataViewSettingCollectionString);
-                       AssertNotNull (m.DataViewSettings);
+                       Assert.IsNull (m.DataSet);
+                       Assert.AreEqual ("", m.DataViewSettingCollectionString);
+                       Assert.IsNotNull (m.DataViewSettings);
                        DataSet ds = new DataSet ("ds");
                        m.DataSet = ds;
-                       AssertEquals ("default#1", defaultString,
-                               m.DataViewSettingCollectionString);
+                       Assert.AreEqual (defaultString, m.DataViewSettingCollectionString,
+                               "default#1");
 
                        DataSet ds2 = new DataSet ("ds2");
-                       AssertEquals ("default#2", defaultString,
-                               ds.DefaultViewManager.DataViewSettingCollectionString);
+                       Assert.AreEqual (defaultString, ds.DefaultViewManager.DataViewSettingCollectionString,
+                               "default#2");
                        DataTable dt2_1 = new DataTable ("table2-1");
                        dt2_1.Namespace ="urn:foo"; // It is ignored though.
                        ds2.Tables.Add (dt2_1);
                        m.DataSet = ds2;
-                       AssertEquals ("#3", current, m.DataViewSettingCollectionString);
+                       Assert.AreEqual (current, m.DataViewSettingCollectionString, "#3");
 
                        // Note that " Deleted " is trimmed.
                        m.DataViewSettingCollectionString = @"<DataViewSettingCollectionString><table2-1 Sort='' RowFilter='' RowStateFilter=' Deleted '/></DataViewSettingCollectionString>";
-                       AssertEquals ("#4", deleted, m.DataViewSettingCollectionString);
+                       Assert.AreEqual (deleted, m.DataViewSettingCollectionString, "#4");
 
                        m.DataSet = ds2; //resets modified string.
-                       AssertEquals ("#5", current, m.DataViewSettingCollectionString);
+                       Assert.AreEqual (current, m.DataViewSettingCollectionString, "#5");
 
                        m.DataViewSettingCollectionString = @"<DataViewSettingCollectionString><table2-1 Sort='' RowFilter='' RowStateFilter='Deleted'/></DataViewSettingCollectionString>";
                        // it does not clear anything.
                        m.DataViewSettingCollectionString = "<DataViewSettingCollectionString/>";
-                       AssertEquals ("#6", deleted, m.DataViewSettingCollectionString);
+                       Assert.AreEqual (deleted, m.DataViewSettingCollectionString, "#6");
 
                        // text node is not rejected (ignored).
                        // RowFilter is not examined.
                        m.DataViewSettingCollectionString = "<DataViewSettingCollectionString>blah<table2-1 RowFilter='a=b' ApplyDefaultSort='true' /></DataViewSettingCollectionString>";
                        // LAMESPEC: MS.NET ignores ApplyDefaultSort.
-//                     AssertEquals ("#7", @"<DataViewSettingCollectionString><table2-1 Sort="""" RowFilter=""a=b"" RowStateFilter=""Deleted""/></DataViewSettingCollectionString>", m.DataViewSettingCollectionString);
+//                     Assert.AreEqual (@"<DataViewSettingCollectionString><table2-1 Sort="""" RowFilter=""a=b"" RowStateFilter=""Deleted""/></DataViewSettingCollectionString>", m.DataViewSettingCollectionString, "#7");
                }
 
                [Test]
index 4be1824f6674c064bd460a4a3f0cab070727b250..8829819a4503b3337adf66c5a9ac6d08436f5ca3 100644 (file)
@@ -42,7 +42,7 @@ using System.IO;
 namespace MonoTests.System.Data
 {
        [TestFixture]
-       public class DataViewTest : Assertion
+       public class DataViewTest
        {
                DataTable dataTable;
                DataView  dataView;
@@ -145,7 +145,7 @@ namespace MonoTests.System.Data
                        dv.Sort = "abc";
                        dv.Sort = string.Empty;
                        dv.Sort = "abc";
-                       AssertEquals ("test#01", "abc", dv.Sort);
+                       Assert.AreEqual ("abc", dv.Sort, "test#01");
                }
 
                [Test]
@@ -154,24 +154,24 @@ namespace MonoTests.System.Data
                        DataView dv1,dv2,dv3;
                        dv1 = new DataView ();
                        // AssertEquals ("test#01",null,dv1.Table);
-                       AssertEquals ("test#02",true,dv1.AllowNew);
-                       AssertEquals ("test#03",true,dv1.AllowEdit);
-                       AssertEquals ("test#04",true,dv1.AllowDelete);
-                       AssertEquals ("test#05",false,dv1.ApplyDefaultSort);
-                       AssertEquals ("test#06",string.Empty,dv1.RowFilter);
-                       AssertEquals ("test#07",DataViewRowState.CurrentRows,dv1.RowStateFilter);
-                       AssertEquals ("test#08",string.Empty,dv1.Sort);
+                       Assert.AreEqual (true,dv1.AllowNew,"test#02");;
+                       Assert.AreEqual (true,dv1.AllowEdit,"test#03");;
+                       Assert.AreEqual (true,dv1.AllowDelete,"test#04");;
+                       Assert.AreEqual (false,dv1.ApplyDefaultSort,"test#05");;
+                       Assert.AreEqual (string.Empty,dv1.RowFilter,"test#06");;
+                       Assert.AreEqual (DataViewRowState.CurrentRows,dv1.RowStateFilter,"test#07");;
+                       Assert.AreEqual (string.Empty,dv1.Sort,"test#08");;
                        
                        dv2 = new DataView (dataTable);
-                       AssertEquals ("test#09","itemTable",dv2.Table.TableName);
-                       AssertEquals ("test#10",string.Empty,dv2.Sort);
-                       AssertEquals ("test#11",false,dv2.ApplyDefaultSort);
-                       AssertEquals ("test#12",dataTable.Rows[0],dv2[0].Row);
+                       Assert.AreEqual ("itemTable",dv2.Table.TableName,"test#09");;
+                       Assert.AreEqual (string.Empty,dv2.Sort,"test#10");;
+                       Assert.AreEqual (false,dv2.ApplyDefaultSort,"test#11");;
+                       Assert.AreEqual (dataTable.Rows[0],dv2[0].Row,"test#12");;
                        
                        dv3 = new DataView (dataTable,"","itemId DESC",DataViewRowState.CurrentRows);
-                       AssertEquals ("test#13","",dv3.RowFilter);
-                       AssertEquals ("test#14","itemId DESC",dv3.Sort);
-                       AssertEquals ("test#15",DataViewRowState.CurrentRows,dv3.RowStateFilter);
+                       Assert.AreEqual ("",dv3.RowFilter,"test#13");;
+                       Assert.AreEqual ("itemId DESC",dv3.Sort,"test#14");;
+                       Assert.AreEqual (DataViewRowState.CurrentRows,dv3.RowStateFilter,"test#15");;
                        //AssertEquals ("test#16",dataTable.Rows.[(dataTable.Rows.Count-1)],dv3[0]);
                }
 
@@ -179,20 +179,20 @@ namespace MonoTests.System.Data
                 public void TestValue ()
                 {
                        DataView TestView = new DataView (dataTable);
-                       Assertion.AssertEquals ("Dv #1", "item 1", TestView [0]["itemId"]);
+                       Assert.AreEqual ("item 1", TestView [0]["itemId"], "Dv #1");
                 }
 
                 [Test]
                 public void TestCount ()
                 {
                        DataView TestView = new DataView (dataTable);
-                       Assertion.AssertEquals ("Dv #3", 5, TestView.Count);
+                       Assert.AreEqual (5, TestView.Count, "Dv #3");
                 }
 
                [Test]
                public void AllowNew ()
                {
-                       AssertEquals ("test#01",true,dataView.AllowNew);
+                       Assert.AreEqual (true, dataView.AllowNew, "test#01");
                }
 
                [Test]
@@ -203,7 +203,7 @@ namespace MonoTests.System.Data
                        dataView.ApplyDefaultSort = true;
                        // dataView.Sort = "itemName";
                        // AssertEquals ("test#01","item 1",dataView[0]["itemId"]);
-                       AssertEquals ("test#02",ListChangedType.Reset,listChangedArgs.ListChangedType);
+                       Assert.AreEqual (ListChangedType.Reset,listChangedArgs.ListChangedType, "test#02");
                        // UnComment the line below to see if dataView is sorted
                        //   PrintTableOrView (dataView,"* OnApplyDefaultSort");
                }
@@ -212,7 +212,7 @@ namespace MonoTests.System.Data
                public void RowStateFilter ()
                {
                        dataView.RowStateFilter = DataViewRowState.Deleted;
-                       AssertEquals ("test#01",ListChangedType.Reset,listChangedArgs.ListChangedType);
+                       Assert.AreEqual (ListChangedType.Reset,listChangedArgs.ListChangedType, "test#01");
                }
 
                [Test]
@@ -239,16 +239,16 @@ namespace MonoTests.System.Data
                        dataView [0] ["col1"] = -1;
                        dataView.RowStateFilter = DataViewRowState.ModifiedOriginal;
                        v = dataView [0] [0].ToString ();
-                       AssertEquals ("ModifiedOriginal.Count", 1, dataView.Count);
-                       AssertEquals ("ModifiedOriginal.Value", "1", v);
+                       Assert.AreEqual (1, dataView.Count, "ModifiedOriginal.Count");
+                       Assert.AreEqual ("1", v, "ModifiedOriginal.Value");
 
                        // Deleting the row
                        dataView.Delete (0);
                        dataView.RowStateFilter = DataViewRowState.Deleted;
 
                        v = dataView [0] [0].ToString ();
-                       AssertEquals ("Deleted.Count", 1, dataView.Count);
-                       AssertEquals ("Deleted.Value", "1", v);
+                       Assert.AreEqual (1, dataView.Count, "Deleted.Count");
+                       Assert.AreEqual ("1", v, "Deleted.Value");
                }
 
                //xamarin bug #18898 # / novell bug #595899
@@ -276,10 +276,10 @@ namespace MonoTests.System.Data
                        another_new_row[0] = "9";
                        another_new_row[1] = "10";
 
-                       AssertEquals ("#1", dv[2][0], "9");
+                       Assert.AreEqual (dv[2][0], "9", "#1");
 
                        //This should not throw a System.Data.VersionNotFoundException: "There is no Proposed data to accces"
-                       AssertEquals ("#1", dv[1][0], "7");     
+                       Assert.AreEqual (dv[1][0], "7", "#1");  
 
                }
 
@@ -288,7 +288,7 @@ namespace MonoTests.System.Data
                {
                        DataView dataview = new DataView ();
                        PropertyDescriptorCollection col = ((ITypedList)dataview).GetItemProperties (null);
-                       AssertEquals ("1", 0, col.Count);
+                       Assert.AreEqual (0, col.Count, "1");
                }
 
                #region Sort Tests
@@ -296,7 +296,7 @@ namespace MonoTests.System.Data
                public void SortListChangedTest ()
                {
                        dataView.Sort = "itemName DESC";
-                       AssertEquals ("test#01",ListChangedType.Reset,listChangedArgs.ListChangedType);
+                       Assert.AreEqual (ListChangedType.Reset,listChangedArgs.ListChangedType, "test#01");
                        // UnComment the line below to see if dataView is sorted
                        // PrintTableOrView (dataView);
                }
@@ -338,60 +338,60 @@ namespace MonoTests.System.Data
                        DataView dataView = dataTable.DefaultView;
 
                        string s = "Default sorting: ";
-                       AssertEquals (s + "First entry has wrong item", 1, dataView[0][0]);
-                       AssertEquals (s + "Second entry has wrong item", 0, dataView[1][0]);
-                       AssertEquals (s + "Third entry has wrong item", 3, dataView[2][0]);
-                       AssertEquals (s + "Fourth entry has wrong item", 2, dataView[3][0]);
+                       Assert.AreEqual (1, dataView[0][0], s + "First entry has wrong item");
+                       Assert.AreEqual (0, dataView[1][0], s + "Second entry has wrong item");
+                       Assert.AreEqual (3, dataView[2][0], s + "Third entry has wrong item");
+                       Assert.AreEqual (2, dataView[3][0], s + "Fourth entry has wrong item");
 
                        s = "Ascending sorting 1: ";
                        dataView.Sort = "itemId ASC";
-                       AssertEquals (s + "First entry has wrong item", 0, dataView[0][0]);
-                       AssertEquals (s + "Second entry has wrong item", 1, dataView[1][0]);
-                       AssertEquals (s + "Third entry has wrong item", 2, dataView[2][0]);
-                       AssertEquals (s + "Fourth entry has wrong item", 3, dataView[3][0]);
+                       Assert.AreEqual (0, dataView[0][0], s + "First entry has wrong item");
+                       Assert.AreEqual (1, dataView[1][0], s + "Second entry has wrong item");
+                       Assert.AreEqual (2, dataView[2][0], s + "Third entry has wrong item");
+                       Assert.AreEqual (3, dataView[3][0], s + "Fourth entry has wrong item");
 
                        // bug #77104 (2-5)
                        s = "Ascending sorting 2: ";
                        dataView.Sort = "itemId     ASC";
-                       AssertEquals (s + "First entry has wrong item", 0, dataView[0][0]);
-                       AssertEquals (s + "Second entry has wrong item", 1, dataView[1][0]);
-                       AssertEquals (s + "Third entry has wrong item", 2, dataView[2][0]);
-                       AssertEquals (s + "Fourth entry has wrong item", 3, dataView[3][0]);
+                       Assert.AreEqual (0, dataView[0][0], s + "First entry has wrong item");
+                       Assert.AreEqual (1, dataView[1][0], s + "Second entry has wrong item");
+                       Assert.AreEqual (2, dataView[2][0], s + "Third entry has wrong item");
+                       Assert.AreEqual (3, dataView[3][0], s + "Fourth entry has wrong item");
 
                        s = "Ascending sorting 3: ";
                        dataView.Sort = "[itemId] ASC";
-                       AssertEquals (s + "First entry has wrong item", 0, dataView[0][0]);
-                       AssertEquals (s + "Second entry has wrong item", 1, dataView[1][0]);
-                       AssertEquals (s + "Third entry has wrong item", 2, dataView[2][0]);
-                       AssertEquals (s + "Fourth entry has wrong item", 3, dataView[3][0]);
+                       Assert.AreEqual (0, dataView[0][0], s + "First entry has wrong item");
+                       Assert.AreEqual (1, dataView[1][0], s + "Second entry has wrong item");
+                       Assert.AreEqual (2, dataView[2][0], s + "Third entry has wrong item");
+                       Assert.AreEqual (3, dataView[3][0], s + "Fourth entry has wrong item");
 
                        s = "Ascending sorting 4: ";
                        dataView.Sort = "[itemId]       ASC";
-                       AssertEquals (s + "First entry has wrong item", 0, dataView[0][0]);
-                       AssertEquals (s + "Second entry has wrong item", 1, dataView[1][0]);
-                       AssertEquals (s + "Third entry has wrong item", 2, dataView[2][0]);
-                       AssertEquals (s + "Fourth entry has wrong item", 3, dataView[3][0]);
+                       Assert.AreEqual (0, dataView[0][0], s + "First entry has wrong item");
+                       Assert.AreEqual (1, dataView[1][0], s + "Second entry has wrong item");
+                       Assert.AreEqual (2, dataView[2][0], s + "Third entry has wrong item");
+                       Assert.AreEqual (3, dataView[3][0], s + "Fourth entry has wrong item");
 
                        s = "Ascending sorting 5: ";
                        try {
                                dataView.Sort = "itemId \tASC";
-                               AssertEquals (s + "Tab cannot be a separator" , true, false);
+                               Assert.AreEqual (true, false, s + "Tab cannot be a separator");
                        }catch (IndexOutOfRangeException e) {
                        }
 
                        s = "Descending sorting : ";
                        dataView.Sort = "itemId DESC";
-                       AssertEquals (s + "First entry has wrong item", 3, dataView[0][0]);
-                       AssertEquals (s + "Second entry has wrong item", 2, dataView[1][0]);
-                       AssertEquals (s + "Third entry has wrong item", 1, dataView[2][0]);
-                       AssertEquals (s + "Fourth entry has wrong item", 0, dataView[3][0]);
+                       Assert.AreEqual (3, dataView[0][0], s + "First entry has wrong item");
+                       Assert.AreEqual (2, dataView[1][0], s + "Second entry has wrong item");
+                       Assert.AreEqual (1, dataView[2][0], s + "Third entry has wrong item");
+                       Assert.AreEqual (0, dataView[3][0], s + "Fourth entry has wrong item");
 
                        s = "Reverted to default sorting: ";
                        dataView.Sort = null;
-                       AssertEquals (s + "First entry has wrong item", 1, dataView[0][0]);
-                       AssertEquals (s + "Second entry has wrong item", 0, dataView[1][0]);
-                       AssertEquals (s + "Third entry has wrong item", 3, dataView[2][0]);
-                       AssertEquals (s + "Fourth entry has wrong item", 2, dataView[3][0]);
+                       Assert.AreEqual (1, dataView[0][0], s + "First entry has wrong item");
+                       Assert.AreEqual (0, dataView[1][0], s + "Second entry has wrong item");
+                       Assert.AreEqual (3, dataView[2][0], s + "Third entry has wrong item");
+                       Assert.AreEqual (2, dataView[3][0], s + "Fourth entry has wrong item");
                }
                
                #endregion // Sort Tests
@@ -409,21 +409,21 @@ namespace MonoTests.System.Data
                {
                        dataView.AllowNew = true;
                        DataRowView drv = dataView.AddNew ();
-                       AssertEquals ("test#01",ListChangedType.ItemAdded,listChangedArgs.ListChangedType);
-                       AssertEquals ("test#02",-1,listChangedArgs.OldIndex);
-                       AssertEquals ("test#03",5,listChangedArgs.NewIndex);
-                       AssertEquals ("test#04",drv["itemName"],dataView [dataView.Count - 1]["itemName"]);
+                       Assert.AreEqual (ListChangedType.ItemAdded,listChangedArgs.ListChangedType, "test#01");
+                       Assert.AreEqual (-1,listChangedArgs.OldIndex, "test#02");
+                       Assert.AreEqual (5,listChangedArgs.NewIndex, "test#03");
+                       Assert.AreEqual (drv["itemName"],dataView [dataView.Count - 1]["itemName"], "test#04");
                        listChangedArgs = null;
                        drv["itemId"] = "item " + 1001;
                        drv["itemName"] = "name " + rndm.Next();
                        drv["itemPrice"] = "Rs. " + (rndm.Next() % 1000);
                        drv["itemCategory"] = "Cat " + ((rndm.Next() % 10) + 1);
                        // Actually no events are arisen when items are set.
-                       AssertNull ("test#05", listChangedArgs);
+                       Assert.IsNull (listChangedArgs, "test#05");
                        drv.CancelEdit ();
-                       AssertEquals ("test#06",ListChangedType.ItemDeleted,listChangedArgs.ListChangedType);
-                       AssertEquals ("test#07",-1,listChangedArgs.OldIndex);
-                       AssertEquals ("test#08",5,listChangedArgs.NewIndex);
+                       Assert.AreEqual (ListChangedType.ItemDeleted,listChangedArgs.ListChangedType, "test#06");
+                       Assert.AreEqual (-1,listChangedArgs.OldIndex, "test#07");
+                       Assert.AreEqual (5,listChangedArgs.NewIndex, "test#08");
                }
 
                [Test]
@@ -439,15 +439,15 @@ namespace MonoTests.System.Data
                        table.Columns.AddRange (new DataColumn[] {col1,col2});
 
                        dv.Table = table;
-                       AssertNull ("#1", dv.Table);
+                       Assert.IsNull (dv.Table, "#1");
                        dv.EndInit ();
 
-                       AssertNull ("#2", dv.Table); // still.
-                       AssertEquals ("#3", 0, table.Columns.Count);
+                       Assert.IsNull (dv.Table, "#2"); // still.
+                       Assert.AreEqual (0, table.Columns.Count, "#3");
 
                        table.EndInit ();
-                       AssertEquals ("#5", table, dv.Table);
-                       AssertEquals ("#4", 2, table.Columns.Count);
+                       Assert.AreEqual (table, dv.Table, "#4");
+                       Assert.AreEqual (2, table.Columns.Count, "#5");
                }
 
                private bool dvInitialized;
@@ -472,19 +472,19 @@ namespace MonoTests.System.Data
                        table.Columns.AddRange (new DataColumn[] {col1,col2});
 
                        dv.Table = table;
-                       AssertNull ("#1", dv.Table);
+                       Assert.IsNull (dv.Table, "#1");
                        dv.EndInit ();
                        
-                       AssertNull ("#2", dv.Table);
-                       AssertEquals ("#3", 0, table.Columns.Count);
+                       Assert.IsNull (dv.Table, "#2");
+                       Assert.AreEqual (0, table.Columns.Count, "#3");
 
                        table.EndInit ();
 
                        dv.Initialized -= new EventHandler (OnDataViewInitialized); // this should not be unregistered before table.EndInit().
                        
-                       AssertEquals ("#4", 2, table.Columns.Count);
-                       AssertEquals ("#6", table, dv.Table);
-                       AssertEquals ("DataViewInitialized #5", true, dvInitialized);
+                       Assert.AreEqual (2, table.Columns.Count, "#4");
+                       Assert.AreEqual (table, dv.Table, "#6");
+                       Assert.AreEqual (true, dvInitialized, "DataViewInitialized #5");
                }
 
                [Test]
@@ -503,21 +503,21 @@ namespace MonoTests.System.Data
                        randInt = rndm.Next () % rowCount;
                        dataView.Sort = "itemId";
                        drv = dataView [randInt];
-                       AssertEquals ("test#01",randInt,dataView.Find (drv ["itemId"]));
+                       Assert.AreEqual (randInt,dataView.Find (drv ["itemId"]), "test#01");
                        
                        dataView.Sort = "itemId DESC";
                        drv = dataView [randInt];
-                       AssertEquals ("test#02",randInt,dataView.Find (drv ["itemId"]));
+                       Assert.AreEqual (randInt,dataView.Find (drv ["itemId"]), "test#02");
                        
                        dataView.Sort = "itemId, itemName";
                        drv = dataView [randInt];
                        object [] keys = new object [2];
                        keys [0] = drv ["itemId"];
                        keys [1] = drv ["itemName"];
-                       AssertEquals ("test#03",randInt,dataView.Find (keys));
+                       Assert.AreEqual (randInt,dataView.Find (keys), "test#03");
                        
                        dataView.Sort = "itemId";
-                       AssertEquals ("test#04",-1,dataView.Find("no item"));
+                       Assert.AreEqual (-1,dataView.Find("no item"), "test#04");
 
                }
 
@@ -540,7 +540,7 @@ namespace MonoTests.System.Data
                [Test]
                public void ToStringTest ()
                {
-                       AssertEquals ("test#01","System.Data.DataView",dataView.ToString());
+                       Assert.AreEqual ("System.Data.DataView",dataView.ToString(), "test#01");
                }
 
                [Test]
@@ -556,38 +556,38 @@ namespace MonoTests.System.Data
                        dataTable.Rows.Add(dr);
 
                        //PrintTableOrView(dataView, "ItemAdded");
-                       AssertEquals ("test#01",ListChangedType.ItemAdded,listChangedArgs.ListChangedType);
+                       Assert.AreEqual (ListChangedType.ItemAdded,listChangedArgs.ListChangedType, "test#01");
                        listChangedArgs = null;
 
                        dr ["itemId"] = "aitem 0";
                        // PrintTableOrView(dataView, "ItemChanged");
-                       AssertEquals ("test#02",ListChangedType.ItemChanged,listChangedArgs.ListChangedType);
+                       Assert.AreEqual (ListChangedType.ItemChanged,listChangedArgs.ListChangedType, "test#02");
                        listChangedArgs = null;
 
                        dr ["itemId"] = "zitem 0";
                        // PrintTableOrView(dataView, "ItemMoved");
-                       AssertEquals ("test#03",ListChangedType.ItemMoved,listChangedArgs.ListChangedType);
+                       Assert.AreEqual (ListChangedType.ItemMoved,listChangedArgs.ListChangedType, "test#03");
                        listChangedArgs = null;
 
                        dataTable.Rows.Remove (dr);
                        // PrintTableOrView(dataView, "ItemDeleted");
-                       AssertEquals ("test#04",ListChangedType.ItemDeleted,listChangedArgs.ListChangedType);
+                       Assert.AreEqual (ListChangedType.ItemDeleted,listChangedArgs.ListChangedType, "test#04");
                        
                        listChangedArgs = null;
                        DataColumn dc5 = new DataColumn ("itemDesc");
                        dataTable.Columns.Add (dc5);
                        // PrintTableOrView(dataView, "PropertyDescriptorAdded");
-                       AssertEquals ("test#05",ListChangedType.PropertyDescriptorAdded,listChangedArgs.ListChangedType);
+                       Assert.AreEqual (ListChangedType.PropertyDescriptorAdded,listChangedArgs.ListChangedType, "test#05");
                        
                        listChangedArgs = null;
                        dc5.ColumnName = "itemDescription";
                        // PrintTableOrView(dataView, "PropertyDescriptorChanged");
-                       // AssertEquals ("test#06",ListChangedType.PropertyDescriptorChanged,listChangedArgs.ListChangedType);
+                       // Assert.AreEqual ("test#06",ListChangedType.PropertyDescriptorChanged,listChangedArgs.ListChangedType);
                        
                        listChangedArgs = null;
                        dataTable.Columns.Remove (dc5);
                        // PrintTableOrView(dataView, "PropertyDescriptorDeleted");
-                       AssertEquals ("test#07",ListChangedType.PropertyDescriptorDeleted,listChangedArgs.ListChangedType);
+                       Assert.AreEqual (ListChangedType.PropertyDescriptorDeleted,listChangedArgs.ListChangedType, "test#07");
                }
        
                [Test]
@@ -596,8 +596,8 @@ namespace MonoTests.System.Data
                        DataView TestView = new DataView (dataTable);
                        TestView.Sort = "itemId";
                        DataRowView[] Result = TestView.FindRows ("item 3");
-                       Assertion.AssertEquals ("Dv #1", 1, Result.Length);
-                       Assertion.AssertEquals ("Dv #2", "item 3", Result [0]["itemId"]);
+                       Assert.AreEqual (1, Result.Length, "Dv #1");
+                       Assert.AreEqual ("item 3", Result [0]["itemId"], "Dv #2");
                }
 
                [Test]
@@ -642,7 +642,7 @@ namespace MonoTests.System.Data
                        DataView TestView = new DataView (dataTable);
                        TestView.Delete (0);
                        DataRow r = TestView.Table.Rows [0];
-                       Assertion.Assert ("Dv #1", !((string)r ["itemId"] == "item 1"));
+                       Assert.IsTrue (!((string)r ["itemId"] == "item 1"), "Dv #1");
                }
 
                [Test]
@@ -685,13 +685,13 @@ namespace MonoTests.System.Data
 
                        DataView dataView = new DataView (dataset.Tables[0]);
 
-                       AssertEquals ("before delete", 3, dataView.Count);
+                       Assert.AreEqual (3, dataView.Count, "before delete");
                        dataView.AllowDelete = true;
 
                        // Deleting the first row
                        dataView.Delete (0);
 
-                       AssertEquals ("before delete", 2, dataView.Count);
+                       Assert.AreEqual (2, dataView.Count, "before delete");
                }
 
                [Test]
@@ -746,7 +746,7 @@ namespace MonoTests.System.Data
                        eventWriter.Write (" ------" + dv.Count);
                        DataRowView a3 = dv.AddNew ();
 
-                       AssertEquals (reference, eventWriter.ToString ());
+                       Assert.AreEqual (reference, eventWriter.ToString ());
                }
 
                [Test]
@@ -766,7 +766,7 @@ table was set.
 
                        dc2.ColumnName = "new_column_name";
 
-                       AssertEquals (result.Replace ("\r\n", "\n"), eventWriter.ToString ().Replace ("\r\n", "\n"));
+                       Assert.AreEqual (result.Replace ("\r\n", "\n"), eventWriter.ToString ().Replace ("\r\n", "\n"));
                }
 
                private void ListChanged (object o, ListChangedEventArgs e)
@@ -830,7 +830,7 @@ removed relation 2
                        ds.Relations.Remove (dr);
                        eventWriter.WriteLine ("removed relation 2");
 
-                       AssertEquals (result.Replace ("\r\n", "\n"), eventWriter.ToString ().Replace ("\r\n", "\n"));
+                       Assert.AreEqual (result.Replace ("\r\n", "\n"), eventWriter.ToString ().Replace ("\r\n", "\n"));
                }
 
                [Test]
@@ -942,7 +942,7 @@ table changed.
                        dv.Table = new DataTable ("table2");
                        eventWriter.WriteLine ("table changed.");
 
-                       AssertEquals (result.Replace ("\r\n", "\n"), eventWriter.ToString ().Replace ("\r\n", "\n"));
+                       Assert.AreEqual (result.Replace ("\r\n", "\n"), eventWriter.ToString ().Replace ("\r\n", "\n"));
                }
 
                [Test]
@@ -982,7 +982,7 @@ table was set.
                        dt.Columns.Add ("");
                        eventWriter.WriteLine (" add a column with an empty name.");
 
-                       AssertEquals (result.Replace ("\r\n", "\n"), eventWriter.ToString ().Replace ("\r\n", "\n"));
+                       Assert.AreEqual (result.Replace ("\r\n", "\n"), eventWriter.ToString ().Replace ("\r\n", "\n"));
                        GC.KeepAlive (dv);
                }
 
index 6e5d2a4df927114b5c0499ff38153f2b41c00ba5..21742eb3aa3cef106b3dd46a42018b4ba70a5d05 100644 (file)
@@ -38,7 +38,7 @@ using System.Data;
 namespace MonoTests.System.Data
 {
        [TestFixture]
-       public class ForeignKeyConstraintTest : Assertion
+       public class ForeignKeyConstraintTest
        {
                private DataSet _ds;
 
@@ -73,23 +73,23 @@ namespace MonoTests.System.Data
                {
                        DataTable Table =  _ds.Tables [0];
                        
-                       AssertEquals ("test#01", 0, Table.Constraints.Count);
+                       Assert.AreEqual (0, Table.Constraints.Count, "test#01");
                        Table =  _ds.Tables [1];
-                       AssertEquals ("test#02", 0, Table.Constraints.Count);
+                       Assert.AreEqual (0, Table.Constraints.Count, "test#02");
                        
                        // ctor (string, DataColumn, DataColumn
                        ForeignKeyConstraint Constraint = new ForeignKeyConstraint ("test", _ds.Tables [0].Columns [2], _ds.Tables [1].Columns [0]);
                        Table = _ds.Tables [1];
                        Table.Constraints.Add (Constraint);
                        
-                       AssertEquals ("test#03", 1, Table.Constraints.Count);
-                       AssertEquals ("test#04", "test", Table.Constraints [0].ConstraintName);
-                       AssertEquals ("test#05", typeof (ForeignKeyConstraint), Table.Constraints [0].GetType ());
+                       Assert.AreEqual (1, Table.Constraints.Count, "test#03");
+                       Assert.AreEqual ("test", Table.Constraints [0].ConstraintName, "test#04");
+                       Assert.AreEqual (typeof (ForeignKeyConstraint), Table.Constraints [0].GetType (), "test#05");
 
                        Table = _ds.Tables [0];
-                       AssertEquals ("test#06", 1, Table.Constraints.Count);
-                       AssertEquals ("test#07", "Constraint1", Table.Constraints [0].ConstraintName);
-                       AssertEquals ("test#08", typeof (UniqueConstraint), Table.Constraints [0].GetType ());
+                       Assert.AreEqual (1, Table.Constraints.Count, "test#06");
+                       Assert.AreEqual ("Constraint1", Table.Constraints [0].ConstraintName, "test#07");
+                       Assert.AreEqual (typeof (UniqueConstraint), Table.Constraints [0].GetType (), "test#08");
                }
                
                // Tests ctor (DataColumn, DataColumn)
@@ -98,23 +98,23 @@ namespace MonoTests.System.Data
                {
                        DataTable Table =  _ds.Tables [0];
                        
-                       AssertEquals ("test#01", 0, Table.Constraints.Count);
+                       Assert.AreEqual (0, Table.Constraints.Count, "test#01");
                        Table =  _ds.Tables [1];
-                       AssertEquals ("test#02", 0, Table.Constraints.Count);
+                       Assert.AreEqual (0, Table.Constraints.Count, "test#02");
                        
                        // ctor (string, DataColumn, DataColumn
                        ForeignKeyConstraint Constraint = new ForeignKeyConstraint (_ds.Tables [0].Columns [2], _ds.Tables [1].Columns [0]);
                        Table = _ds.Tables [1];
                        Table.Constraints.Add (Constraint);
                        
-                       AssertEquals ("test#03", 1, Table.Constraints.Count);
-                       AssertEquals ("test#04", "Constraint1", Table.Constraints [0].ConstraintName);
-                       AssertEquals ("test#05", typeof (ForeignKeyConstraint), Table.Constraints [0].GetType ());
+                       Assert.AreEqual (1, Table.Constraints.Count, "test#03");
+                       Assert.AreEqual ("Constraint1", Table.Constraints [0].ConstraintName, "test#04");
+                       Assert.AreEqual (typeof (ForeignKeyConstraint), Table.Constraints [0].GetType (), "test#05");
 
                        Table = _ds.Tables [0];
-                       AssertEquals ("test#06", 1, Table.Constraints.Count);
-                       AssertEquals ("test#07", "Constraint1", Table.Constraints [0].ConstraintName);
-                       AssertEquals ("test#08", typeof (UniqueConstraint), Table.Constraints [0].GetType ());
+                       Assert.AreEqual (1, Table.Constraints.Count, "test#06");
+                       Assert.AreEqual ("Constraint1", Table.Constraints [0].ConstraintName, "test#07");
+                       Assert.AreEqual (typeof (UniqueConstraint), Table.Constraints [0].GetType (), "test#08");
                }
                
                // Test ctor (DataColumn [], DataColumn [])
@@ -123,9 +123,9 @@ namespace MonoTests.System.Data
                {
                        DataTable Table =  _ds.Tables [0];
                        
-                       AssertEquals ("test#01", 0, Table.Constraints.Count);
+                       Assert.AreEqual (0, Table.Constraints.Count, "test#01");
                        Table =  _ds.Tables [1];
-                       AssertEquals ("test#02", 0, Table.Constraints.Count);
+                       Assert.AreEqual (0, Table.Constraints.Count, "test#02");
                                                
                        DataColumn [] Cols1 = new DataColumn [2];
                        Cols1 [0] = _ds.Tables [0].Columns [1];
@@ -139,14 +139,14 @@ namespace MonoTests.System.Data
                        Table = _ds.Tables [1];
                        Table.Constraints.Add (Constraint);
                        
-                       AssertEquals ("test#03", 1, Table.Constraints.Count);
-                       AssertEquals ("test#04", "Constraint1", Table.Constraints [0].ConstraintName);
-                       AssertEquals ("test#05", typeof (ForeignKeyConstraint), Table.Constraints [0].GetType ());
+                       Assert.AreEqual (1, Table.Constraints.Count, "test#03");
+                       Assert.AreEqual ("Constraint1", Table.Constraints [0].ConstraintName, "test#04");
+                       Assert.AreEqual (typeof (ForeignKeyConstraint), Table.Constraints [0].GetType (), "test#05");
 
                        Table = _ds.Tables [0];
-                       AssertEquals ("test#06", 1, Table.Constraints.Count);
-                       AssertEquals ("test#07", "Constraint1", Table.Constraints [0].ConstraintName);
-                       AssertEquals ("test#08", typeof (UniqueConstraint), Table.Constraints [0].GetType ());
+                       Assert.AreEqual (1, Table.Constraints.Count, "test#06");
+                       Assert.AreEqual ("Constraint1", Table.Constraints [0].ConstraintName, "test#07");
+                       Assert.AreEqual (typeof (UniqueConstraint), Table.Constraints [0].GetType (), "test#08");
 
                }
        
@@ -156,9 +156,9 @@ namespace MonoTests.System.Data
                {
                        DataTable Table =  _ds.Tables [0];
                        
-                       AssertEquals ("test#01", 0, Table.Constraints.Count);
+                       Assert.AreEqual (0, Table.Constraints.Count, "test#01");
                        Table =  _ds.Tables [1];
-                       AssertEquals ("test#02", 0, Table.Constraints.Count);
+                       Assert.AreEqual (0, Table.Constraints.Count, "test#02");
                                                
                        DataColumn [] Cols1 = new DataColumn [2];
                        Cols1 [0] = _ds.Tables [0].Columns [1];
@@ -172,14 +172,14 @@ namespace MonoTests.System.Data
                        Table = _ds.Tables [1];
                        Table.Constraints.Add (Constraint);
                        
-                       AssertEquals ("test#03", 1, Table.Constraints.Count);
-                       AssertEquals ("test#04", "Test", Table.Constraints [0].ConstraintName);
-                       AssertEquals ("test#05", typeof (ForeignKeyConstraint), Table.Constraints [0].GetType ());
+                       Assert.AreEqual (1, Table.Constraints.Count, "test#03");
+                       Assert.AreEqual ("Test", Table.Constraints [0].ConstraintName, "test#04");
+                       Assert.AreEqual (typeof (ForeignKeyConstraint), Table.Constraints [0].GetType (), "test#05");
 
                        Table = _ds.Tables [0];
-                       AssertEquals ("test#06", 1, Table.Constraints.Count);
-                       AssertEquals ("test#07", "Constraint1", Table.Constraints [0].ConstraintName);
-                       AssertEquals ("test#08", typeof (UniqueConstraint), Table.Constraints [0].GetType ());                  
+                       Assert.AreEqual (1, Table.Constraints.Count, "test#06");
+                       Assert.AreEqual ("Constraint1", Table.Constraints [0].ConstraintName, "test#07");
+                       Assert.AreEqual (typeof (UniqueConstraint), Table.Constraints [0].GetType (), "test#08");
                }
                
                [Test]
@@ -211,7 +211,7 @@ namespace MonoTests.System.Data
                         ForeignKeyConstraint fkc = new ForeignKeyConstraint ("hello world", parentTableName, parentColumnNames, childColumnNames, AcceptRejectRule.Cascade, Rule.Cascade, Rule.Cascade);                                                                                                                            // Assert that the Constraint object does not belong to any table yet
                        try {
                                DataTable tmp = fkc.Table;
-                               Fail ("When table is null, get_Table causes an InvalidOperationException.");
+                               Assert.Fail ("When table is null, get_Table causes an InvalidOperationException.");
                        } catch (NullReferenceException) { // actually .NET throws this (bug)
                        } catch (InvalidOperationException) {
                        }
@@ -234,9 +234,12 @@ namespace MonoTests.System.Data
                         // OK - So AddRange() is the only way!
                         table2.Constraints.AddRange (constraints);
                           // After AddRange(), Check the properties of ForeignKeyConstraint object
-                        Assertion.Assert("#A04", fkc.RelatedColumns [0].ColumnName.Equals ("col1"));                        Assertion.Assert("#A05", fkc.RelatedColumns [1].ColumnName.Equals ("col2"));                        Assertion.Assert("#A06", fkc.RelatedColumns [2].ColumnName.Equals ("col3"));                        Assertion.Assert("#A07", fkc.Columns [0].ColumnName.Equals ("col4"));
-                        Assertion.Assert("#A08", fkc.Columns [1].ColumnName.Equals ("col5"));
-                        Assertion.Assert("#A09", fkc.Columns [2].ColumnName.Equals ("col6"));
+                        Assert.IsTrue(fkc.RelatedColumns [0].ColumnName.Equals ("col1"), "#A04");
+                        Assert.IsTrue(fkc.RelatedColumns [1].ColumnName.Equals ("col2"), "#A05");
+                        Assert.IsTrue(fkc.RelatedColumns [2].ColumnName.Equals ("col3"), "#A06");
+                        Assert.IsTrue(fkc.Columns [0].ColumnName.Equals ("col4"), "#A07");
+                        Assert.IsTrue(fkc.Columns [1].ColumnName.Equals ("col5"), "#A08");
+                        Assert.IsTrue(fkc.Columns [2].ColumnName.Equals ("col6"), "#A09");
 #endif
                         // Try to add columns with names which do not exist in the table
                         parentColumnNames [2] = "noColumn";
@@ -255,7 +258,7 @@ namespace MonoTests.System.Data
                         
 #if false // FIXME: Here this test crashes under MS.NET.
                         // Check whether the child table really contains the foreign key constraint named "hello world"
-                        Assertion.Assert("#A11 ", table2.Constraints.Contains ("hello world"));
+                        Assert.IsTrue(table2.Constraints.Contains ("hello world"), "#A11 ");
 #endif
                 }
 
@@ -267,20 +270,20 @@ namespace MonoTests.System.Data
                {
                        DataTable Table =  _ds.Tables [0];
                        
-                       AssertEquals ("test#01", 0, Table.Constraints.Count);
+                       Assert.AreEqual (0, Table.Constraints.Count, "test#01");
                        Table =  _ds.Tables [1];
-                       AssertEquals ("test#02", 0, Table.Constraints.Count);
+                       Assert.AreEqual (0, Table.Constraints.Count, "test#02");
                                                
                        
                        ForeignKeyConstraint Constraint = new ForeignKeyConstraint ("Test", _ds.Tables [0].Columns [0], _ds.Tables [0].Columns [2]);
                        Table = _ds.Tables [0];
                        Table.Constraints.Add (Constraint);
                        
-                       AssertEquals ("test#03", 2, Table.Constraints.Count);
-                       AssertEquals ("test#04", "Constraint1", Table.Constraints [0].ConstraintName);
-                       AssertEquals ("test#05", typeof (UniqueConstraint), Table.Constraints [0].GetType ());
-                       AssertEquals ("test#04", "Test", Table.Constraints [1].ConstraintName);
-                       AssertEquals ("test#05", typeof (ForeignKeyConstraint), Table.Constraints [1].GetType ());
+                       Assert.AreEqual (2, Table.Constraints.Count, "test#03");
+                       Assert.AreEqual ("Constraint1", Table.Constraints [0].ConstraintName, "test#04");
+                       Assert.AreEqual (typeof (UniqueConstraint), Table.Constraints [0].GetType (), "test#05");
+                       Assert.AreEqual ("Test", Table.Constraints [1].ConstraintName, "test#04");
+                       Assert.AreEqual (typeof (ForeignKeyConstraint), Table.Constraints [1].GetType (), "test#05");
 
                }
 
@@ -297,45 +300,45 @@ namespace MonoTests.System.Data
                        try
                        {
                                fkc = new ForeignKeyConstraint((DataColumn)null,(DataColumn)null);
-                               Fail("Failed to throw ArgumentNullException.");
+                               Assert.Fail("Assert.Failed to throw ArgumentNullException.");
                        }
                        catch (NullReferenceException) {}
                        catch (AssertionException exc) {throw exc;}
                        catch (Exception exc)
                        {
-                               Fail("A1: Wrong Exception type. " + exc.ToString());
+                               Assert.Fail("A1: Wrong Exception type. " + exc.ToString());
                        }
 
                        //zero length collection
                        try
                        {
                                fkc = new ForeignKeyConstraint(new DataColumn[]{},new DataColumn[]{});
-                               Fail("B1: Failed to throw ArgumentException.");
+                               Assert.Fail("B1: Assert.Failed to throw ArgumentException.");
                        }
                        catch (ArgumentException) {}
                        catch (AssertionException exc) {throw exc;}
                        catch (Exception exc)
                        {
-                               Fail("A2: Wrong Exception type. " + exc.ToString());
+                               Assert.Fail("A2: Wrong Exception type. " + exc.ToString());
                        }
 
                        //different datasets
                        try
                        {
                                fkc = new ForeignKeyConstraint(_ds.Tables[0].Columns[0], localTable.Columns[0]);
-                               Fail("Failed to throw InvalidOperationException.");
+                               Assert.Fail("Assert.Failed to throw InvalidOperationException.");
                        }
                        catch (InvalidOperationException) {}
                        catch (AssertionException exc) {throw exc;}
                        catch (Exception exc)
                        {
-                               Fail("A3: Wrong Exception type. " + exc.ToString());
+                               Assert.Fail("A3: Wrong Exception type. " + exc.ToString());
                        }
 
                        try
                        {
                                fkc = new ForeignKeyConstraint(_ds.Tables[0].Columns[0], localTable.Columns[1]);
-                               Fail("Failed to throw InvalidConstraintException.");
+                               Assert.Fail("Assert.Failed to throw InvalidConstraintException.");
                        }
                        // tables in different datasets
                        catch (InvalidOperationException) {}
@@ -345,7 +348,7 @@ namespace MonoTests.System.Data
                         try                                           
                         {                                             
                                 fkc = new ForeignKeyConstraint(new DataColumn [] {_ds.Tables[0].Columns[0], _ds.Tables[0].Columns[1]}, new DataColumn [] {localTable.Columns[1], _ds.Tables[1].Columns [0]});    
-                                Fail("Failed to throw InvalidOperationException.");                                         
+                                Assert.Fail("Assert.Failed to throw InvalidOperationException.");                                         
                         }                                             
                         catch (InvalidConstraintException) {}         
                         catch (AssertionException exc) {throw exc;} 
@@ -362,13 +365,13 @@ namespace MonoTests.System.Data
                        try 
                        {
                                fkc = new ForeignKeyConstraint(col, _ds.Tables[0].Columns[0]);
-                               Fail("FTT1: Failed to throw ArgumentException.");
+                               Assert.Fail("FTT1: Assert.Failed to throw ArgumentException.");
                        }
                        catch (ArgumentException) {}
                        catch (AssertionException exc) {throw exc;}
 //                     catch (Exception exc)
 //                     {
-//                             Fail("WET1: Wrong Exception type. " + exc.ToString());
+//                             Assert.Fail("WET1: Wrong Exception type. " + exc.ToString());
 //                     }
 
                        //Columns must belong to the same table
@@ -382,13 +385,13 @@ namespace MonoTests.System.Data
                                                                 _ds.Tables[0].Columns[1],
                                                                _ds.Tables[0].Columns[0]});
                                        
-                               Fail("FTT2: Failed to throw InvalidConstraintException.");
+                               Assert.Fail("FTT2: Assert.Failed to throw InvalidConstraintException.");
                        }
                        catch (InvalidConstraintException) {}
                        catch (AssertionException exc) {throw exc;}
                        catch (Exception exc)
                        {
-                               Fail("WET2: Wrong Exception type. " + exc.ToString());
+                               Assert.Fail("WET2: Wrong Exception type. " + exc.ToString());
                        }
 
 
@@ -403,13 +406,13 @@ namespace MonoTests.System.Data
                                fkc = new ForeignKeyConstraint(twoCol, 
                                        new DataColumn[] { _ds.Tables[0].Columns[0]});
                                        
-                               Fail("FTT3: Failed to throw ArgumentException.");
+                               Assert.Fail("FTT3: Assert.Failed to throw ArgumentException.");
                        }
                        catch (ArgumentException) {}
                        catch (AssertionException exc) {throw exc;}
                        catch (Exception exc)
                        {
-                               Fail("WET3: Wrong Exception type. " + exc.ToString());
+                               Assert.Fail("WET3: Wrong Exception type. " + exc.ToString());
                        }
 
                        //InvalidOperation: Parent and child are the same column.
@@ -418,13 +421,13 @@ namespace MonoTests.System.Data
                                fkc = new ForeignKeyConstraint( _ds.Tables[0].Columns[0],
                                        _ds.Tables[0].Columns[0] );
                                        
-                               Fail("FTT4: Failed to throw InvalidOperationException.");
+                               Assert.Fail("FTT4: Assert.Failed to throw InvalidOperationException.");
                        }
                        catch (InvalidOperationException) {}
                        catch (AssertionException exc) {throw exc;}
                        catch (Exception exc)
                        {
-                               Fail("WET4: Wrong Exception type. " + exc.ToString());
+                               Assert.Fail("WET4: Wrong Exception type. " + exc.ToString());
                        }
 
                }
@@ -446,14 +449,14 @@ namespace MonoTests.System.Data
                        ForeignKeyConstraint fkcDiff = 
                                new ForeignKeyConstraint( tbl.Columns[1], tbl.Columns[2]);
                
-                       Assert( "Equals failed. 1" , fkc.Equals(fkc2));
-                       Assert( "Equals failed. 2" , fkc2.Equals(fkc));
-                       Assert( "Equals failed. 3" , fkc.Equals(fkc));
+                       Assert.IsTrue( fkc.Equals(fkc2) , "Equals Assert.IsTrue.Failed. 1");
+                       Assert.IsTrue( fkc2.Equals(fkc) , "Equals Assert.IsTrue.Failed. 2");
+                       Assert.IsTrue( fkc.Equals(fkc) , "Equals Assert.IsTrue.Failed. 3");
 
-                       Assert( "Equals failed diff. 1" , fkc.Equals(fkcDiff) == false);
+                       Assert.IsTrue( fkc.Equals(fkcDiff) == false , "Equals Assert.IsTrue.Failed diff. 1");
 
-                       //Assert( "Hash Code Failed. 1", fkc.GetHashCode() == fkc2.GetHashCode() );
-                       Assert( "Hash Code Failed. 2", fkc.GetHashCode() != fkcDiff.GetHashCode() );
+                       //Assert.IsTrue( "Hash Code Assert.IsTrue.Failed. 1", fkc.GetHashCode() == fkc2.GetHashCode() );
+                       Assert.IsTrue( fkc.GetHashCode() != fkcDiff.GetHashCode() , "Hash Code Assert.IsTrue.Failed. 2");
        
                }
 
@@ -512,7 +515,7 @@ namespace MonoTests.System.Data
                        t2.Rows.Add (new object [] {10});
 
                        t1.Rows [0][0]=20;
-                       Assert("#1", (int)t2.Rows [0][0] == 20);
+                       Assert.IsTrue((int)t2.Rows [0][0] == 20, "#1");
                }
 
                [Test]
index cc8196e0c9681eb1f568b93e8cc7f6ccb8e2b72c..0a99b71bc323319293eddc6fbbfde4d7053512f7 100644 (file)
@@ -38,7 +38,7 @@ using NUnit.Framework;
 namespace MonoTests.System.Xml
 {
        [TestFixture]
-       public class XmlDataDocumentTest2 : Assertion
+       public class XmlDataDocumentTest2 
        {
                string xml = "<NewDataSet><table><row><col1>1</col1><col2>2</col2></row></table></NewDataSet>";
 
@@ -53,8 +53,8 @@ namespace MonoTests.System.Xml
                public void TestDefaultCtor ()
                {
                        XmlDataDocument doc = new XmlDataDocument ();
-                       AssertNotNull (doc.DataSet);
-                       AssertEquals ("NewDataSet", doc.DataSet.DataSetName);
+                       Assert.IsNotNull (doc.DataSet);
+                       Assert.AreEqual ("NewDataSet", doc.DataSet.DataSetName);
                }
 
                [Test]
@@ -117,73 +117,73 @@ namespace MonoTests.System.Xml
                        ds.Relations.Add (rel);\r
                        XmlDataDocument doc = new XmlDataDocument (ds);\r
                        doc.LoadXml ("<set><tab1><col1>1</col1><col2/><child><ref>1</ref><val>aaa</val></child></tab1></set>");\r
-                       AssertEquals (1, ds.Tables [0].Rows.Count);\r
-                       AssertEquals (1, ds.Tables [1].Rows.Count);\r
+                       Assert.AreEqual (1, ds.Tables [0].Rows.Count);\r
+                       Assert.AreEqual (1, ds.Tables [1].Rows.Count);\r
 \r
                        // document element - no mapped row\r
                        XmlElement el = doc.DocumentElement;\r
-                       AssertNull (doc.GetRowFromElement (el));\r
+                       Assert.IsNull (doc.GetRowFromElement (el));\r
 \r
                        // tab1 element - has mapped row\r
                        el = el.FirstChild as XmlElement;\r
                        DataRow row = doc.GetRowFromElement (el);\r
-                       AssertNotNull (row);\r
-                       AssertEquals (DataRowState.Added, row.RowState);\r
+                       Assert.IsNotNull (row);\r
+                       Assert.AreEqual (DataRowState.Added, row.RowState);\r
 \r
                        // col1 - it is column. no mapped row\r
                        el = el.FirstChild as XmlElement;\r
                        row = doc.GetRowFromElement (el);\r
-                       AssertNull (row);\r
+                       Assert.IsNull (row);\r
 \r
                        // col2 - it is column. np mapped row\r
                        el = el.NextSibling as XmlElement;\r
                        row = doc.GetRowFromElement (el);\r
-                       AssertNull (row);\r
+                       Assert.IsNull (row);\r
 \r
                        // child - has mapped row\r
                        el = el.NextSibling as XmlElement;\r
                        row = doc.GetRowFromElement (el);\r
-                       AssertNotNull (row);\r
-                       AssertEquals (DataRowState.Added, row.RowState);\r
+                       Assert.IsNotNull (row);\r
+                       Assert.AreEqual (DataRowState.Added, row.RowState);\r
 \r
                        // created (detached) table 1 element (used later)\r
                        el = doc.CreateElement ("tab1");\r
                        row = doc.GetRowFromElement (el);\r
-                       AssertEquals (DataRowState.Detached, row.RowState);\r
-                       AssertEquals (1, dt.Rows.Count); // not added yet\r
+                       Assert.AreEqual (DataRowState.Detached, row.RowState);\r
+                       Assert.AreEqual (1, dt.Rows.Count); // not added yet\r
 \r
                        // adding a node before setting EnforceConstraints\r
                        // raises an error\r
                        try {\r
                                doc.DocumentElement.AppendChild (el);\r
-                               Fail ("Invalid Operation should occur; EnforceConstraints prevents addition.");\r
+                               Assert.Fail ("Invalid Operation should occur; EnforceConstraints prevents addition.");\r
                        } catch (InvalidOperationException) {\r
                        }\r
 \r
                        // try again...\r
                        ds.EnforceConstraints = false;\r
-                       AssertEquals (1, dt.Rows.Count); // not added yet\r
+                       Assert.AreEqual (1, dt.Rows.Count); // not added yet\r
                        doc.DocumentElement.AppendChild (el);\r
-                       AssertEquals (2, dt.Rows.Count); // added\r
+                       Assert.AreEqual (2, dt.Rows.Count); // added\r
                        row = doc.GetRowFromElement (el);\r
-                       AssertEquals (DataRowState.Added, row.RowState); // changed\r
+                       Assert.AreEqual (DataRowState.Added, row.RowState); // changed\r
 \r
                        // Irrelevant element\r
                        XmlElement el2 = doc.CreateElement ("hoge");\r
                        row = doc.GetRowFromElement (el2);\r
-                       AssertNull (row);\r
+                       Assert.IsNull (row);\r
 \r
                        // created table 2 element (used later)\r
                        el = doc.CreateElement ("child");\r
                        row = doc.GetRowFromElement (el);\r
-                       AssertEquals (DataRowState.Detached, row.RowState);\r
+                       Assert.AreEqual (DataRowState.Detached, row.RowState);\r
 \r
                        // Adding it to irrelevant element performs no row state change.\r
-                       AssertEquals (1, dt2.Rows.Count); // not added yet\r
+                       Assert.AreEqual (1, dt2.Rows.Count); // not added yet\r
                        el2.AppendChild (el);\r
-                       AssertEquals (1, dt2.Rows.Count); // still not added\r
+                       Assert.AreEqual (1, dt2.Rows.Count); // still not added\r
                        row = doc.GetRowFromElement (el);\r
-                       AssertEquals (DataRowState.Detached, row.RowState); // still detached here\r
+                       Assert.AreEqual (DataRowState.Detached, row.RowState); // still detached here\r
                }\r
 
                // bug #54505
@@ -244,8 +244,8 @@ namespace MonoTests.System.Xml
                        StringReader sr = new StringReader (sw.ToString());
                        doc1.Load (sr);
 
-                       AssertEquals ("#1", 1, ds1.Tables [0].Rows.Count);
-                       AssertEquals ("#2", 1, ds1.Tables [0].Rows [0][0]);
+                       Assert.AreEqual (1, ds1.Tables [0].Rows.Count, "#1");
+                       Assert.AreEqual (1, ds1.Tables [0].Rows [0][0], "#2");
                }
 
                [Test]
@@ -267,8 +267,8 @@ namespace MonoTests.System.Xml
                        StringReader sr = new StringReader (sw.ToString());
                        doc1.Load (sr);
 
-                       AssertEquals ("#1", 1, ds1.Tables [0].Rows [0][0]);
-                       AssertEquals ("#2", true, ds1.Tables [0].Rows [0].IsNull (1));
+                       Assert.AreEqual (1, ds1.Tables [0].Rows [0][0], "#1");
+                       Assert.AreEqual (true, ds1.Tables [0].Rows [0].IsNull (1), "#2");
                }
 
                [Test]
@@ -301,9 +301,9 @@ namespace MonoTests.System.Xml
                        StringReader sreader = new StringReader (swriter.ToString ());
                        DataSet ds1 = ds.Clone ();
                        XmlDataDocument doc1 = new XmlDataDocument (ds1);
-                       AssertEquals ("#2" , 0, ds1.Tables [0].Rows.Count);
+                       Assert.AreEqual (0 , ds1.Tables [0].Rows.Count, "#2");
                        doc1.Load (sreader);
-                       AssertEquals ("#3" , 3, ds1.Tables [0].Rows.Count);
+                       Assert.AreEqual (3 , ds1.Tables [0].Rows.Count, "#3");
                }
        }
 }
index cbab4c217e351dd889fb43deb4e38ddaf89e334c..86b4617162fc6748ee66e72bc260d87eb70c45d4 100644 (file)
@@ -53,7 +53,7 @@ namespace SoapShared
                        Serialize(obj, ms);\r
                        ms.Position = 0;\r
                        Object des = Deserialize(ms);\r
-                       Assertion.AssertEquals(obj.GetType(), des.GetType());\r
+                       Assert.AreEqual (obj.GetType(), des.GetType());\r
                }\r
 \r
                private void Serialize(object ob, Stream stream)\r
index d3914d9b327e196bbcb49272f85209a824af0798..3aee88df4a84300bb5aa06789fee44bc0d07f56d 100644 (file)
@@ -222,7 +222,7 @@ namespace MonoTests.System.Runtime.Serialization.Formatters.Soap
                        if (expected != null && expected.GetType().IsArray)\r
                                EqualsArray (message, (Array)expected, (Array)actual);\r
                        else\r
-                               Assertion.AssertEquals (message, expected, actual);\r
+                               Assert.AreEqual (expected, actual, message);\r\r
                }\r
 \r
                public static void EqualsArray (string message, object oar1, object oar2)\r
index 9735ce04b04384613adcd857558bf1c0e3010d9e..91fdd7857d861780fc152c39bed8dd11247859a7 100644 (file)
@@ -171,8 +171,8 @@ namespace MonoTests.System.Runtime.Serialization.Formatters.Soap {
                \r
                private object Serialize(object objGraph) {\r
                        MemoryStream stream = new MemoryStream();\r
-                       Assertion.Assert(objGraph != null);\r
-                       Assertion.Assert(stream != null);\r
+                       Assert.IsTrue(objGraph != null);\r
+                       Assert.IsTrue(stream != null);\r
                        _soapFormatter.SurrogateSelector = _surrogate;\r
                        _soapFormatter.Serialize(stream, objGraph);\r
                        \r
@@ -182,8 +182,8 @@ namespace MonoTests.System.Runtime.Serialization.Formatters.Soap {
                        stream.Position = 0;\r
                        \r
                        object objReturn = _soapFormatterDeserializer.Deserialize(stream);\r
-                       Assertion.Assert(objReturn != null);\r
-                       Assertion.AssertEquals("#Tests "+objGraph.GetType(), objGraph.GetType(), objReturn.GetType());\r
+                       Assert.IsTrue(objReturn != null);\r
+                       Assert.AreEqual(objGraph.GetType(), objReturn.GetType(), "#Tests "+objGraph.GetType());\r
                        stream = new MemoryStream();\r
                        _soapFormatter.Serialize(stream, objReturn);\r
                        stream.Position = 0;\r
@@ -209,19 +209,19 @@ namespace MonoTests.System.Runtime.Serialization.Formatters.Soap {
                public void TestValueTypes() {\r
                        object objReturn;\r
                        objReturn = Serialize((short)1);\r
-                       Assertion.AssertEquals("#int16", objReturn, 1);\r
+                       Assert.AreEqual(objReturn, 1, "#int16");\r
                        objReturn = Serialize(1);\r
-                       Assertion.AssertEquals("#int32", objReturn, 1);\r
+                       Assert.AreEqual(objReturn, 1, "#int32");\r
                        objReturn = Serialize((Single)0.1234);\r
-                       Assertion.AssertEquals("#Single", objReturn, 0.123400003f);\r
+                       Assert.AreEqual(objReturn, 0.123400003f, "#Single");\r
                        objReturn = Serialize((Double)1234567890.0987654321);\r
-                       Assertion.AssertEquals("#iDouble", objReturn, 1234567890.0987654321);\r
+                       Assert.AreEqual(objReturn, 1234567890.0987654321, "#iDouble");\r
                        objReturn = Serialize(true);\r
-                       Assertion.AssertEquals("#Bool", objReturn, true);\r
+                       Assert.AreEqual(objReturn, true, "#Bool");\r
                        objReturn = Serialize((Int64) 1234567890);\r
-                       Assertion.AssertEquals("#Int64", objReturn, 1234567890);\r
+                       Assert.AreEqual(objReturn, 1234567890, "#Int64");\r
                        objReturn = Serialize('c');\r
-                       Assertion.AssertEquals("#Char", objReturn, 'c');\r
+                       Assert.AreEqual(objReturn, 'c', "#Char");\r
                }\r
                \r
                [Test]\r
@@ -229,7 +229,7 @@ namespace MonoTests.System.Runtime.Serialization.Formatters.Soap {
                        object objReturn;\r
                        objReturn = Serialize("");\r
                        objReturn = Serialize("hello world!");\r
-                       Assertion.AssertEquals("#string", "hello world!", objReturn);\r
+                       Assert.AreEqual("hello world!", objReturn, "#string");\r
                        SoapMessage soapMsg = new SoapMessage();\r
                        soapMsg.Headers = new Header[0];\r
                        soapMsg.MethodName = "Equals";\r
@@ -242,27 +242,27 @@ namespace MonoTests.System.Runtime.Serialization.Formatters.Soap {
                        _soapFormatterDeserializer.TopObject = null;\r
                        SimpleObject obj = new SimpleObject("simple object", 1);\r
                        objReturn = Serialize(obj);\r
-                       Assertion.AssertEquals("#SimpleObject", obj, objReturn);\r
+                       Assert.AreEqual(obj, objReturn, "#SimpleObject");\r
                        objReturn = Serialize(typeof(SimpleObject));\r
-                       Assertion.AssertEquals("#Type", typeof(SimpleObject), (Type)objReturn);\r
+                       Assert.AreEqual(typeof(SimpleObject), (Type)objReturn, "#Type");\r
                        objReturn = Serialize(obj.GetType().Assembly);\r
-                       Assertion.AssertEquals("#Assembly", obj.GetType().Assembly, objReturn);\r
+                       Assert.AreEqual(obj.GetType().Assembly, objReturn, "#Assembly");\r
                }\r
                \r
                public static bool CheckArray(object objTest, object objReturn) {\r
                        Array objTestAsArray = objTest as Array;\r
                        Array objReturnAsArray = objReturn as Array;\r
                        \r
-                       Assertion.Assert("#Not an Array "+objTest, objReturnAsArray != null);\r
-                       Assertion.AssertEquals("#Different lengths "+objTest, objTestAsArray.Length, objReturnAsArray.Length);\r
-                       \r
+                       Assert.IsTrue(objReturnAsArray != null, "#Not an Array "+objTest);\r
+                       Assert.AreEqual(objTestAsArray.Length, objReturnAsArray.Length, "#Different lengths "+objTest);\r
+                       
                        IEnumerator iEnum = objReturnAsArray.GetEnumerator();\r
                        iEnum.Reset();\r
                        object obj2;\r
                        foreach(object obj1 in objTestAsArray) {\r
                                iEnum.MoveNext();\r
                                obj2 = iEnum.Current;\r
-                               Assertion.AssertEquals("#The content of the 2 arrays is different", obj1, obj2);\r
+                               Assert.AreEqual(obj1, obj2, "#The content of the 2 arrays is different");\r
                        }\r
                        \r
                        return true;\r
@@ -315,9 +315,9 @@ namespace MonoTests.System.Runtime.Serialization.Formatters.Soap {
                        MoreComplexObject objReturn;\r
                        MoreComplexObject objTest = new MoreComplexObject();\r
                        objReturn = (MoreComplexObject) Serialize(objTest);\r
-                       Assertion.AssertEquals("#Equals", objTest, objReturn);\r
+                       Assert.AreEqual(objTest, objReturn, "#Equals");\r
                        objReturn.OnTrucEvent("bidule");\r
-                       Assertion.AssertEquals("#dlg", "bidule", objReturn.ObjString);\r
+                       Assert.AreEqual("bidule", objReturn.ObjString, "#dlg");\r
                }\r
 \r
                [Test]\r
@@ -333,9 +333,9 @@ namespace MonoTests.System.Runtime.Serialization.Formatters.Soap {
                        _soapFormatterDeserializer.Binder = new Version1ToVersion2Binder();\r
                        objReturn = _soapFormatterDeserializer.Deserialize(stream);\r
 \r
-                       Assertion.AssertEquals("#Version1 Version2", "Version2", objReturn.GetType().Name);\r
-                       Assertion.AssertEquals("#_value", 123, ((Version2) objReturn)._value);\r
-                       Assertion.AssertEquals("#_foo", "Default value", ((Version2) objReturn)._foo);\r
+                       Assert.AreEqual("Version2", objReturn.GetType().Name, "#Version1 Version2");\r
+                       Assert.AreEqual(123, ((Version2) objReturn)._value, "#_value");\r
+                       Assert.AreEqual("Default value", ((Version2) objReturn)._foo, "#_foo");\r
                }\r
                \r
                [Test]\r
@@ -360,17 +360,17 @@ namespace MonoTests.System.Runtime.Serialization.Formatters.Soap {
                        sf.TopObject = t;\r
                        t = (SoapMessage) sf.Deserialize (ms);\r
                        \r
-                       Assertion.AssertNotNull ("#1", t.Headers[0].Value);\r
-                       Assertion.AssertEquals ("#2", t.Headers[0].Value.GetType (), typeof(Type[]));\r
+                       Assert.IsNotNull (t.Headers[0].Value, "#1");\r
+                       Assert.AreEqual (t.Headers[0].Value.GetType (), typeof(Type[]), "#2");\r
                        \r
                        Type[] ts = (Type[]) t.Headers[0].Value;\r
                        \r
-                       Assertion.AssertEquals ("#3", 2, ts.Length);\r
-                       Assertion.AssertNotNull ("#4", ts[0]);\r
-                       Assertion.AssertNotNull ("#5", ts[1]);\r
+                       Assert.AreEqual (2, ts.Length, "#3");\r
+                       Assert.IsNotNull (ts[0], "#4");\r
+                       Assert.IsNotNull (ts[1], "#5");\r
                        Console.WriteLine ("PPP:" + ts[0].GetType());\r
-                       Assertion.AssertEquals ("#6", typeof(string), ts[0]);\r
-                       Assertion.AssertEquals ("#7", typeof(SignatureTest[]), ts[1]);\r
+                       Assert.AreEqual (typeof(string), ts[0], "#6");\r
+                       Assert.AreEqual (typeof(SignatureTest[]), ts[1], "#7");\r
                }\r
 \r
                [Test]\r
@@ -398,14 +398,14 @@ namespace MonoTests.System.Runtime.Serialization.Formatters.Soap {
                        public void OnDeserialization (StreamingContext context)\r
                        {\r
                                var ci = Thread.CurrentThread.CurrentCulture;\r
-                               Assertion.AssertEquals("#1", "German (Germany)", ci.EnglishName);\r
+                               Assert.AreEqual("German (Germany)", ci.EnglishName, "#1");\r
                        }\r
                        \r
                        [OnSerialized]\r
                        public void OnSerialized (StreamingContext context)\r
                        {\r
                                var ci = Thread.CurrentThread.CurrentCulture;\r
-                               Assertion.AssertEquals("#2", "German (Germany)", ci.EnglishName);\r
+                               Assert.AreEqual("German (Germany)", ci.EnglishName, "#2");\r
                        }\r
                }\r
        }\r
index 33f83eccec481a4768b360eb7a4552b41b38f936..968038e5c3657b7995306ffa4a6750391770cf0e 100644 (file)
@@ -7,7 +7,9 @@
 
 using System;
 using System.IO;
+using System.Text;
 using System.Threading;
+using System.Diagnostics;
 using System.Collections.Generic;
 using Microsoft.Win32.SafeHandles;
 
@@ -16,6 +18,8 @@ namespace System.Net.Sockets {
        sealed class SafeSocketHandle : SafeHandleZeroOrMinusOneIsInvalid {
 
                List<Thread> blocking_threads;
+               Dictionary<Thread, StackTrace> threads_stacktraces;
+
                bool in_cleanup;
 
                const int SOCKET_CLOSED = 10004;
@@ -26,6 +30,9 @@ namespace System.Net.Sockets {
                public SafeSocketHandle (IntPtr preexistingHandle, bool ownsHandle) : base (ownsHandle)
                {
                        SetHandle (preexistingHandle);
+
+                       if (THROW_ON_ABORT_RETRIES)
+                               threads_stacktraces = new Dictionary<Thread, StackTrace> ();
                }
 
                // This is just for marshalling
@@ -48,8 +55,17 @@ namespace System.Net.Sockets {
                                        int abort_attempts = 0;
                                        while (blocking_threads.Count > 0) {
                                                if (abort_attempts++ >= ABORT_RETRIES) {
-                                                       if (THROW_ON_ABORT_RETRIES)
-                                                               throw new Exception ("Could not abort registered blocking threads before closing socket.");
+                                                       if (THROW_ON_ABORT_RETRIES) {
+                                                               StringBuilder sb = new StringBuilder ();
+                                                               sb.AppendLine ("Could not abort registered blocking threads before closing socket.");
+                                                               foreach (var thread in blocking_threads) {
+                                                                       sb.AppendLine ("Thread StackTrace:");
+                                                                       sb.AppendLine (threads_stacktraces[thread].ToString ());
+                                                               }
+                                                               sb.AppendLine ();
+
+                                                               throw new Exception (sb.ToString ());
+                                                       }
 
                                                        // Attempts to close the socket safely failed.
                                                        // We give up, and close the socket with pending blocking system calls.
@@ -94,6 +110,8 @@ namespace System.Net.Sockets {
                                /* We must use a finally block here to make this atomic. */
                                lock (blocking_threads) {
                                        blocking_threads.Add (Thread.CurrentThread);
+                                       if (THROW_ON_ABORT_RETRIES)
+                                               threads_stacktraces.Add (Thread.CurrentThread, new StackTrace (true));
                                }
                                if (release)
                                        DangerousRelease ();
@@ -110,6 +128,9 @@ namespace System.Net.Sockets {
                        //If this NRE, we're in deep problems because Register Must have
                        lock (blocking_threads) {
                                blocking_threads.Remove (Thread.CurrentThread);
+                               if (THROW_ON_ABORT_RETRIES)
+                                       threads_stacktraces.Remove (Thread.CurrentThread);
+
                                if (in_cleanup && blocking_threads.Count == 0)
                                        Monitor.Pulse (blocking_threads);
                        }
index cb8b01de36f644f5b2c2ed5fe135b43c6d43f4bb..c7576897189c0e6c30b155b2380569a1867cc119 100644 (file)
@@ -3176,7 +3176,7 @@ namespace System.Net.Sockets
                {
                        ThrowIfDisposedAndClosed ();
 
-                       if (optionName == SocketOptionName.ReuseAddress && optionValue != 0 && !SupportsPortReuse ())
+                       if (optionLevel == SocketOptionLevel.Socket && optionName == SocketOptionName.ReuseAddress && optionValue != 0 && !SupportsPortReuse (protocol_type))
                                throw new SocketException ((int) SocketError.OperationNotSupported, "Operating system sockets do not support ReuseAddress.\nIf your socket is not intended to bind to the same address and port multiple times remove this option, otherwise you should ignore this exception inside a try catch and check that ReuseAddress is true before binding to the same address and port multiple times.");
 
                        int error;
@@ -3479,7 +3479,7 @@ namespace System.Net.Sockets
                internal static extern void cancel_blocking_socket_operation (Thread thread);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               internal static extern bool SupportsPortReuse ();
+               internal static extern bool SupportsPortReuse (ProtocolType proto);
        }
 }
 
index dbc4110cb20c65a6822e4568331fc90b36091cd7..ec9d6b1bb0a4acadf905e1c9e8135ce34aa5f8ed 100644 (file)
@@ -190,7 +190,7 @@ namespace MonoTests.System.ComponentModel.Design.Serialization {
                {
 #if MOBILE
                        // ensure the property is not linked out of the application since it make the test fails
-                       Assert.NotNull (Thread.CurrentPrincipal, "pre-test");
+                       Assert.IsNotNull (Thread.CurrentPrincipal, "pre-test");
 #endif
                        PropertyInfo pi = typeof (Thread).GetProperty ("CurrentPrincipal");
 
@@ -213,7 +213,7 @@ namespace MonoTests.System.ComponentModel.Design.Serialization {
                {
 #if MOBILE
                        // ensure the property is not linked out of the application since it make the test fails
-                       Assert.NotNull (Thread.CurrentPrincipal, "pre-test");
+                       Assert.IsNotNull (Thread.CurrentPrincipal, "pre-test");
 #endif
                        PropertyInfo pi = typeof (Thread).GetProperty ("CurrentPrincipal");
 
index f137139a55f6f110dedb325a862eba722d69572b..d59d39fad89d232798a341ce06bdd238b3da044f 100644 (file)
@@ -106,11 +106,11 @@ namespace MonoTests.System.Net.Sockets
                        bool res = clientSocket.SendAsync (e);
                        if (res) {
                                if (!m.WaitOne (1500))
-                                       throw new TimeoutException ();
+                                       Assert.Fail ("Timeout #1");
                        }
 
                        if (!mainEvent.WaitOne (1500))
-                               throw new TimeoutException ();
+                               Assert.Fail ("Timeout #2");
                        if (error != null)
                                throw error;
 
@@ -124,13 +124,13 @@ namespace MonoTests.System.Net.Sockets
                        res = clientSocket.SendAsync (e);
                        if (res) {
                                if (!m.WaitOne (1500))
-                                       throw new TimeoutException ();
+                                       Assert.Fail ("Timeout #3");
                        }
 
                        if (!mainEvent.WaitOne (1500))
-                               throw new TimeoutException ();
+                               Assert.Fail ("Timeout #4");
                        if (error != null)
                                throw error;
                }
        }
-}
\ No newline at end of file
+}
index 77fb73e3f00ed1404dbe81fe1a68294f5d7068a2..3afff1226ae85d5d8207c551ca5a2dac459f6cec 100644 (file)
@@ -154,7 +154,7 @@ namespace MonoTests.System.Net {
                        Send (ns, "GET / HTTP/1.1\r\n\r\n"); // No host
                        string response = Receive (ns, 512);
                        ns.Close ();
-                       StringAssert.StartsWith ("HTTP/1.1 400", response);
+                       Assert.IsTrue(response.StartsWith ("HTTP/1.1 400"));
                }
 
                [Test]
@@ -166,7 +166,7 @@ namespace MonoTests.System.Net {
                        Send (ns, "GET / HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n"); // no prefix
                        string response = Receive (ns, 512);
                        ns.Close ();
-                       StringAssert.StartsWith ("HTTP/1.1 400", response);
+                       Assert.IsTrue(response.StartsWith ("HTTP/1.1 400"));
                }
 
                [Test]
@@ -204,7 +204,7 @@ namespace MonoTests.System.Net {
                                string response = Receive (ns, 512);
                                ns.Close ();
                                listener.Close ();
-                               StringAssert.StartsWith ("HTTP/1.1 400", response, String.Format ("Failed on {0}", (int) b));
+                               Assert.IsTrue(response.StartsWith ("HTTP/1.1 400"), String.Format ("Failed on {0}", (int) b));
                        }
                }
 
@@ -217,7 +217,7 @@ namespace MonoTests.System.Net {
                        Send (ns, "POST /test4/ HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n"); // length required
                        string response = Receive (ns, 512);
                        ns.Close ();
-                       StringAssert.StartsWith ("HTTP/1.1 411", response);
+                       Assert.IsTrue(response.StartsWith ("HTTP/1.1 411"));
                }
 
                [Test]
@@ -229,7 +229,7 @@ namespace MonoTests.System.Net {
                        Send (ns, "POST / HTTP/1.1\r\nHost: 127.0.0.1\r\nTransfer-Encoding: pepe\r\n\r\n"); // not implemented
                        string response = Receive (ns, 512);
                        ns.Close ();
-                       StringAssert.StartsWith ("HTTP/1.1 501", response);
+                       Assert.IsTrue(response.StartsWith ("HTTP/1.1 501"));
                }
 
                [Test]
@@ -242,7 +242,7 @@ namespace MonoTests.System.Net {
                        Send (ns, "POST /test6/ HTTP/1.1\r\nHost: 127.0.0.1\r\nTransfer-Encoding: identity\r\n\r\n");
                        string response = Receive (ns, 512);
                        ns.Close ();
-                       StringAssert.StartsWith ("HTTP/1.1 501", response);
+                       Assert.IsTrue(response.StartsWith ("HTTP/1.1 501"));
                }
 
                [Test]
@@ -257,8 +257,8 @@ namespace MonoTests.System.Net {
                        ctx.Response.Close ();
                        string response = Receive (ns, 1024);
                        ns.Close ();
-                       StringAssert.StartsWith ("HTTP/1.1 200", response);
-                       StringAssert.Contains ("Transfer-Encoding: chunked", response);
+                       Assert.IsTrue(response.StartsWith ("HTTP/1.1 200"));
+                       Assert.IsTrue(response.Contains ("Transfer-Encoding: chunked"));
                }
 
                [Test]
@@ -274,7 +274,7 @@ namespace MonoTests.System.Net {
                        ctx.Response.Close ();
                        string response = Receive (ns, 512);
                        ns.Close ();
-                       StringAssert.StartsWith ("HTTP/1.1 200", response);
+                       Assert.IsTrue(response.StartsWith ("HTTP/1.1 200"));
                        Assert.IsTrue (-1 == response.IndexOf ("Transfer-Encoding: chunked"));
                }
 
@@ -290,7 +290,7 @@ namespace MonoTests.System.Net {
                        string response = ReceiveWithTimeout (ns, 512, 1000, out timeout);
                        ns.Close ();
                        Assert.IsFalse (timeout);
-                       StringAssert.StartsWith ("HTTP/1.1 411", response);
+                       Assert.IsTrue(response.StartsWith ("HTTP/1.1 411"));
                }
 
                [Test]
@@ -306,7 +306,7 @@ namespace MonoTests.System.Net {
                        string response = ReceiveWithTimeout (ns, 512, 1000, out timeout);
                        ns.Close ();
                        Assert.IsFalse (timeout);
-                       StringAssert.StartsWith ("HTTP/1.1 411", response);
+                       Assert.IsTrue(response.StartsWith ("HTTP/1.1 411"));
                }
 
                [Test]
@@ -320,7 +320,7 @@ namespace MonoTests.System.Net {
                        ns.GetSocket ().Shutdown (SocketShutdown.Send);
                        string input = Receive (ns, 512);
                        ns.Close ();
-                       StringAssert.StartsWith ("HTTP/1.1 400", input);
+                       Assert.IsTrue(input.StartsWith ("HTTP/1.1 400"));
                }
 
                [Test]
@@ -334,7 +334,7 @@ namespace MonoTests.System.Net {
                        ns.GetSocket ().Shutdown (SocketShutdown.Send);
                        string input = Receive (ns, 512);
                        ns.Close ();
-                       StringAssert.StartsWith ("HTTP/1.1 400", input);
+                       Assert.IsTrue(input.StartsWith ("HTTP/1.1 400"));
                }
 
                [Test]
@@ -348,7 +348,7 @@ namespace MonoTests.System.Net {
                        ns.GetSocket ().Shutdown (SocketShutdown.Send);
                        string input = Receive (ns, 512);
                        ns.Close ();
-                       StringAssert.StartsWith ("HTTP/1.1 400", input);
+                       Assert.IsTrue(input.StartsWith ("HTTP/1.1 400"));
                }
 
                HttpListenerRequest test14_request;
@@ -448,8 +448,8 @@ namespace MonoTests.System.Net {
                        ctx.Response.Close ();
                        string response = Receive (ns, 1024);
                        ns.Close ();
-                       StringAssert.StartsWith ("HTTP/1.1 200", response);
-                       StringAssert.Contains ("Transfer-Encoding: chunked", response);
+                       Assert.IsTrue(response.StartsWith ("HTTP/1.1 200"));
+                       Assert.IsTrue(response.Contains ("Transfer-Encoding: chunked"));
                }
 
                [Test]
index a289a6b5e76e2ac19ac91ec28b641c358d2fcf10..ee6c82895e3e7ae5914ca2ffb463a39cc7fdb9d8 100644 (file)
@@ -2311,7 +2311,6 @@ namespace MonoTests.System.Net
                        completed [1] = new ManualResetEvent (false);
 
                        using (ListenerScope scope = new ListenerScope (processor, port, completed [0])) {
-                               ManualResetEvent clientCompleted = new ManualResetEvent (false);
                                Uri address = new Uri (string.Format ("http://localhost:{0}", port));
                                HttpWebRequest client = (HttpWebRequest) WebRequest.Create (address);
 
index 2b6a95ff768e56529024f14abce4e5f0c7cab5fd..3dd8cf239af06c93b0219b6d7aacabf5b0cef022 100644 (file)
@@ -40,7 +40,6 @@ namespace MonoTests.System.Timers
        public class TimerTest
        {
                Timer timer;
-               int _elapsedCount;
 
                [SetUp]
                public void SetUp ()
@@ -287,19 +286,46 @@ namespace MonoTests.System.Timers
                        Assert.IsFalse (timer.Enabled, "#3");
                }
 
-               [Test] // bug #325368
+               [Test] // bug https://bugzilla.novell.com/show_bug.cgi?id=325368
                public void EnabledInElapsed ()
                {
-                       _elapsedCount = 0;
+                       var elapsedCount = 0;
+                       var mre = new ST.ManualResetEventSlim ();
                        timer = new Timer (50);
                        timer.AutoReset = false;
-                       timer.Elapsed += new ElapsedEventHandler (EnabledInElapsed_Elapsed);
+                       timer.Elapsed += (s, e) =>
+                       {
+                               elapsedCount++;
+                               if (elapsedCount == 1)
+                                       timer.Enabled = true;
+                               else if (elapsedCount == 2)
+                                       mre.Set ();
+                       };
                        timer.Start ();
 
-                       ST.Thread.Sleep (200);
+                       Assert.IsTrue (mre.Wait (500), "#1 re-enabling timer in Elapsed didn't work");
+                       Assert.AreEqual (2, elapsedCount, "#2 wrong elapsedCount");
                        timer.Stop ();
+               }
 
-                       Assert.IsTrue (_elapsedCount == 2,  "#1 loss of events");
+               [Test]
+               public void AutoResetEventFalseStopsFiringElapsed ()
+               {
+                       var elapsedCount = 0;
+                       var mre = new ST.ManualResetEventSlim ();
+                       timer = new Timer (50);
+                       timer.AutoReset = false;
+                       timer.Elapsed += (s, e) =>
+                       {
+                               elapsedCount++;
+                               if (elapsedCount > 1)
+                                       mre.Set ();
+                       };
+                       timer.Start ();
+
+                       Assert.IsFalse (mre.Wait (500), "#1 AutoResetEvent=false didn't stop firing Elapsed, elapsedCount=" + elapsedCount);
+                       Assert.AreEqual (1, elapsedCount, "#2 wrong elapsedCount");
+                       timer.Stop ();
                }
 
                [Test]
@@ -308,14 +334,6 @@ namespace MonoTests.System.Timers
                        Assert.IsTrue (new RaceTest (true).Success, "#1");
                        Assert.IsTrue (new RaceTest (false).Success, "#2");
                }
-
-               void EnabledInElapsed_Elapsed (object sender, ElapsedEventArgs e)
-               {
-                       _elapsedCount++;
-                       Timer t = sender as Timer;
-                       if (_elapsedCount == 1)
-                               t.Enabled = true;
-               }
        }
 
        class RaceTest
index fd5e734534ef56ad965b2fc8621ab86df4206507..dcfe35c85fc8899c4bf94d62686b272cfce0e50c 100644 (file)
@@ -57,7 +57,7 @@ namespace System {
                 * of icalls, do not require an increment.
                 */
 #pragma warning disable 169
-               private const int mono_corlib_version = 149;
+               private const int mono_corlib_version = 150;
 #pragma warning restore 169
 
                [ComVisible (true)]
index 94ff296ced511a8752575675a1f99ad0b4eed515..007c0a44d9d314420699358453e1537b89c61e9c 100644 (file)
@@ -179,48 +179,48 @@ namespace MonoTests.Mono.Math.Arithmetic.Big {
                [Test]
                public void AgtB () 
                {
-                       Assertion.Assert(A > B);
+                       Assert.IsTrue(A > B);
                }
                
                [Test]
                public void ANotLtB () 
                {
-                       Assertion.Assert(!(A < B));
+                       Assert.IsTrue(!(A < B));
                }
                
                [Test]
                public void BNotGtA () 
                {
-                       Assertion.Assert(!(B > A));
+                       Assert.IsTrue(!(B > A));
                }
                
                [Test]
                public void AltB () 
                {
-                       Assertion.Assert(B < A);
+                       Assert.IsTrue(B < A);
                }
                
                [Test]
                public void AeqA () 
                {
-                       Assertion.Assert(A == A);
+                       Assert.IsTrue(A == A);
                }
                [Test]
                public void BeqB () 
                {
-                       Assertion.Assert(B == B);
+                       Assert.IsTrue(B == B);
                }
                
                [Test]
                public void AneqB () 
                {
-                       Assertion.Assert(A != B);
+                       Assert.IsTrue(A != B);
                }
                
                [Test]
                public void BneqA () 
                {
-                       Assertion.Assert(B != A);
+                       Assert.IsTrue(B != A);
                }
 
                #endregion
index e6ddb0fc36ea2431ba66db0be801552f2dc38893..b1ba0d26e6eccdaad8a3a6bb71161dd321269d37 100644 (file)
@@ -81,12 +81,12 @@ namespace MonoTests.Mono.Math {
 
                private void ExpectComposite (BigInteger bi)
                {
-                       Assertion.AssertEquals (false, bi.isProbablePrime ());
+                       Assert.AreEqual (false, bi.isProbablePrime ());
                }
 
                private void ExpectPrime (BigInteger bi)
                {
-                       Assertion.AssertEquals (true, bi.isProbablePrime ());
+                       Assert.AreEqual (true, bi.isProbablePrime ());
                }
        }
 
index 4b4b3b3a805435ed9d707ba690ad2a6f0df0137a..ce4f22174b18ed9442e60785e48be5e91b72d01a 100644 (file)
@@ -770,7 +770,7 @@ namespace MonoTests.System.Collections
                        for (int i = 0; i < 20; i++)
                                sl1.RemoveAt (9);
 
-                       Assert.AreEqual (30, sl1.Count, 30, "#C1");
+                       Assert.AreEqual (30, (double) sl1.Count, 30, "#C1");
                        for (int i = 0; i < 9; i++)
                                Assert.AreEqual (i, sl1 ["kala " + string.Format ("{0:D2}", i)], "#C2:" + i);
                        for (int i = 9; i < 29; i++)
index b43d9fd08954b011f170b3629bf0fe147a876a91..bc3416441cfad03b93e428301df40573aaff264e 100644 (file)
@@ -182,7 +182,10 @@ namespace MonoTests.System.Reflection
                        // note: only available in default appdomain
                        // http://weblogs.asp.net/asanto/archive/2003/09/08/26710.aspx
                        // Not sure we should emulate this behavior.
-#if !MONODROID
+#if __WATCHOS__
+                       Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
+                       Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
+#elif !MONODROID
                        string fname = AppDomain.CurrentDomain.FriendlyName;
                        if (fname.EndsWith (".dll")) { // nunit-console
                                Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
@@ -249,7 +252,7 @@ namespace MonoTests.System.Reflection
                public void Corlib_test ()
                {
                        Assembly corlib_test = Assembly.GetExecutingAssembly ();
-#if MONODROID || MOBILE_STATIC
+#if MONODROID || MOBILE_STATIC || __WATCHOS__
                        Assert.IsNull (corlib_test.EntryPoint, "EntryPoint");
                        Assert.IsNull (corlib_test.Evidence, "Evidence");
 #elif MOBILE
index 2124aa85733b05943c15d6c00f8c006ed856713e..2391dbb65071a4f0a313703b9e3aac16d322de59 100644 (file)
@@ -1876,7 +1876,7 @@ namespace MonoTests.System {
                                iTest++;
                                Assert.AreEqual ((float)0, Convert.ToSingle(tryByte), "#N03");
                                iTest++;
-                               Assert.AreEqual ((float)1234, 234, Convert.ToSingle(tryDec), "#N04");
+                               Assert.AreEqual ((float)1234, (double)234, Convert.ToSingle(tryDec), "#N04");
                                iTest++;
                                Assert.AreEqual ((float)0, Convert.ToSingle(tryDbl), "#N05");
                                iTest++;
@@ -1888,7 +1888,7 @@ namespace MonoTests.System {
                                iTest++;
                                Assert.AreEqual ((float)123, Convert.ToSingle(trySByte), "#N09");
                                iTest++;
-                               Assert.AreEqual ((float)1234, 2345, Convert.ToSingle(tryFloat), "#N10");
+                               Assert.AreEqual ((float)1234, (double)2345, Convert.ToSingle(tryFloat), "#N10");
                                iTest++;
                                Assert.AreEqual ((float)987, Convert.ToSingle("987"), "#N11");
                                iTest++;
index deb0e3314b650593fd20d1b2c71e5f0a84200468..fed370974e584b8d5c33dd49eca0a75dc87de8e6 100644 (file)
@@ -156,9 +156,13 @@ namespace MonoTests.System
                public void GetCommandLineArgs ()
                {
                        string[] args = Environment.GetCommandLineArgs ();
+#if !__WATCHOS__
                        Assert.IsNotNull (args, "not null");
                        Assert.IsTrue (((args.Length > 0) && (args.Length < 256)), "reasonable");
                        Assert.IsNotNull (args [0], "application");
+#else
+                       Assert.AreEqual (0, args.Length, "length");
+#endif
                }
 
 #if !NET_2_1
index 5b7b87f5d95487016e1885af15c16d7c934f9c2c..191d5dd7ac888e8b87e994f98ba0242c999923d8 100644 (file)
@@ -45,45 +45,45 @@ build and the tests will be run along with all the others.
 
 * Tips
 
--- Provide an unique error message for Assertion.Assert ()
+-- Provide an unique error message for Assert.IsTrue ()
 
-Include an unique message for each Assertion.Assert () so that when the assert
+Include an unique message for each Assert.IsTrue () so that when the assert
 fails, it is trivial to locate the failing one. Otherwise, it may be
 difficult to determine which part of the test is failing. A good way
 to ensure unique messages is to use something like #A01, #A02 etc.
 
     Bad:
 
-       Assertion.AssertEquals ("array match", compare[0], i1[0]);
-       Assertion.AssertEquals ("array match", compare[1], i1[1]);
-       Assertion.AssertEquals ("array match", compare[2], i1[2]);
-       Assertion.AssertEquals ("array match", compare[3], i1[3]);
+       Assert.AreEqual (compare[0], i1[0], "array match");
+       Assert.AreEqual (compare[1], i1[1], "array match");
+       Assert.AreEqual (compare[2], i1[2], "array match");
+       Assert.AreEqual (compare[3], i1[3], "array match");
 
     Good:
 
-       Assertion.AssertEquals ("#A01", compare[0], i1[0]);
-       Assertion.AssertEquals ("#A02", compare[1], i1[1]);
-       Assertion.AssertEquals ("#A03", compare[2], i1[2]);
-       Assertion.AssertEquals ("#A04", compare[3], i1[3]);
+       Assert.AreEqual (compare[0], i1[0], "#A01");
+       Assert.AreEqual (compare[1], i1[1], "#A02");
+       Assert.AreEqual (compare[2], i1[2], "#A03");
+       Assert.AreEqual (compare[3], i1[3], "#A04");
 
-Once you used such a number in an Assertion.Assert (), don't change it later on -
+Once you used such a number in an Assert.IsTrue (), don't change it later on -
 people might use it it identify the test in bug reports or in mailing
 lists.
 
--- Use Assertion.AssertEquals () to compare things, not Assertion.Assert ().
+-- Use Assert.AreEqual () to compare things, not Assert.IsTrue ().
 
-Never compare two values with Assertion.Assert () - if the test fails, people
-have no idea what went wrong while Assertion.AssertEquals () reports the failed
+Never compare two values with Assert.IsTrue () - if the test fails, people
+have no idea what went wrong while Assert.AreEqual () reports the failed
 value. Also, make sure the second paramter is the expected value, and the third
 parameter is the actual value.
 
     Bad:
 
-        Assertion.Assert ("A01", myTicks[0] == t1.Ticks);
+        Assert.IsTrue (myTicks[0] == t1.Ticks, "A01");
 
     Good:
 
-        Assertion.AssertEquals ("A01", myTicks[0], t1.Ticks);
+        Assert.AreEqual (myTicks[0], t1.Ticks, "A01");
 
 -- Namespace
 
diff --git a/mcs/errors/cs0121-28.cs b/mcs/errors/cs0121-28.cs
new file mode 100644 (file)
index 0000000..e722e1c
--- /dev/null
@@ -0,0 +1,29 @@
+// CS0121: The call is ambiguous between the following methods or properties: `Program.Foo(System.Func<string,dynamic>)' and `Program.Foo(System.Func<object>)'
+// Line: 10
+
+using System;
+
+public static class Program
+{
+       public static void Main ()
+       {
+               Foo (Bar);
+       }
+
+       public static dynamic Bar (string s1)
+       {
+               return 1;
+       }
+       
+       public static object Bar () {
+               return  2;
+       }
+
+       public static void Foo (Func<string, dynamic> input)
+       {
+       }
+
+       public static void Foo (Func<object> input)
+       {
+       }
+}
\ No newline at end of file
index 127df271c794c073834a48f79eb922e6c569c6da..efc5927303ac94674dbba013c3f969c5ef8653d5 100644 (file)
@@ -4596,12 +4596,24 @@ namespace Mono.CSharp {
                                p = Nullable.NullableInfo.GetUnderlyingType (p);
                                if (!BuiltinTypeSpec.IsPrimitiveType (p))
                                        return 0;
+
+                               //
+                               // Spec expects implicit conversion check between p and q, q and p
+                               // to be done before nullable unwrapping but that's expensive operation
+                               // Hence manual tweak is needed because BetterTypeConversion works on
+                               // unwrapped types
+                               //
+                               if (p == q)
+                                       return 2;
                        }
 
                        if (q.IsNullableType) {
                                q = Nullable.NullableInfo.GetUnderlyingType (q);
                                if (!BuiltinTypeSpec.IsPrimitiveType (q))
                                        return 0;
+
+                               if (q == p)
+                                       return 1;
                        }
 
                        return BetterTypeConversion (rc, p, q);
@@ -4642,8 +4654,9 @@ namespace Mono.CSharp {
                                }
                                break;
                        case BuiltinTypeSpec.Type.Dynamic:
-                               // Dynamic is never better
-                               return 2;
+                               // LAMESPEC: Dynamic conversions is not considered
+                               p = ec.Module.Compiler.BuiltinTypes.Object;
+                               break;
                        }
 
                        switch (q.BuiltinType) {
@@ -4673,8 +4686,9 @@ namespace Mono.CSharp {
                                }
                                break;
                        case BuiltinTypeSpec.Type.Dynamic:
-                               // Dynamic is never better
-                               return 1;
+                               // LAMESPEC: Dynamic conversions is not considered
+                               q = ec.Module.Compiler.BuiltinTypes.Object;
+                               break;
                        }
 
                        // TODO: this is expensive
index c47d89dc628e655e1a7f3f42a32a410dcd3491fb..405b7225a52ec1854c6d78901ce589ab1a308682 100644 (file)
@@ -15,6 +15,8 @@ public static class Program
                NN (0);
                NN2 (1);
                Complex (null);
+               MM (1);
+               MM ((byte) 1);
                return 0;
        }
 
@@ -71,4 +73,13 @@ public static class Program
        {
                throw new ApplicationException ("wrong overload");
        }
+
+       static void MM (double f)
+       {
+       }
+
+       static void MM (double? f)
+       {
+               throw new ApplicationException ("wrong overload");
+       }
 }
\ No newline at end of file
index 77762b44440ecdb2fbca11401b8f5ccae5aa0c96..79fc14d77a9089ffffa2fa431a6acb78cc25fffd 100644 (file)
   <test name="test-935.cs">
     <type name="Program">
       <method name="Int32 Main()" attrs="150">
-        <size>73</size>
+        <size>101</size>
       </method>
       <method name="Void TT(System.Threading.Tasks.Task`1[System.String])" attrs="145">
         <size>2</size>
         <size>0</size>
       </method>
     </type>
+    <type name="Program">
+      <method name="Void MM(Double)" attrs="145">
+        <size>2</size>
+      </method>
+      <method name="Void MM(System.Nullable`1[System.Double])" attrs="145">
+        <size>12</size>
+      </method>
+    </type>
   </test>
   <test name="test-94.cs">
     <type name="Base">
index aaa53ffe16d157b16554960ba51f2ab35c430ab8..6d0da527bd65c54a31c77c2f1b0255c0d43add1a 100644 (file)
@@ -969,7 +969,7 @@ wapi_sendfile (guint32 socket, gpointer fd, guint32 bytes_to_write, guint32 byte
                /* TODO: Might not send the entire file for non-blocking sockets */
                res = sendfile (file, socket, 0, &statbuf.st_size, NULL, 0);
 #endif
-       } while (res != -1 && (errno == EINTR || errno == EAGAIN) && !_wapi_thread_cur_apc_pending ());
+       } while (res != -1 && errno == EINTR && !_wapi_thread_cur_apc_pending ());
        if (res == -1) {
                errnum = errno;
                errnum = errno_to_WSA (errnum, __func__);
index eb3f68204036d2f79ab525c3995a8a3a689867e4..c57d8e9fb5b9f9db68819846e311953c5a4e6671 100644 (file)
@@ -82,7 +82,7 @@
  * Changes which are already detected at runtime, like the addition
  * of icalls, do not require an increment.
  */
-#define MONO_CORLIB_VERSION 149
+#define MONO_CORLIB_VERSION 150
 
 typedef struct
 {
@@ -2235,7 +2235,9 @@ ves_icall_System_AppDomain_ExecuteAssembly (MonoAppDomain *ad,
                mono_error_assert_ok (&error);
        }
 
-       return mono_runtime_exec_main (method, (MonoArray *)args, NULL);
+       int res = mono_runtime_exec_main_checked (method, (MonoArray *)args, &error);
+       mono_error_set_pending_exception (&error);
+       return res;
 }
 
 gint32 
index 326251cc140c53a575ff7e227abcdeea92bc2782..f0e2f0d58c8fcbf1fdc89d337f116e67a0376762 100644 (file)
@@ -197,7 +197,8 @@ __int32 STDMETHODCALLTYPE _CorExeMain(void)
                argv [i] = g_utf16_to_utf8 (argvw [i], -1, NULL, NULL, NULL);
        LocalFree (argvw);
 
-       mono_runtime_run_main (method, argc, argv, NULL);
+       mono_runtime_run_main_checked (method, argc, argv, &error);
+       mono_error_raise_exception (&error); /* FIXME don't raise here */
        mono_thread_manage ();
 
        mono_runtime_quit ();
index 3bab96e4e59d55be5a8e550fc4bfddd47e93a8bd..ee0f6ab546ab55a4c933df452df3add21e567ed2 100644 (file)
@@ -1740,6 +1740,21 @@ mono_runtime_delegate_invoke_checked (MonoObject *delegate, void **params,
 MonoArray*
 mono_runtime_get_main_args_checked (MonoError *error);
 
+int
+mono_runtime_run_main_checked (MonoMethod *method, int argc, char* argv[],
+                              MonoError *error);
+
+int
+mono_runtime_try_run_main (MonoMethod *method, int argc, char* argv[],
+                          MonoObject **exc, MonoError *error);
+
+int
+mono_runtime_exec_main_checked (MonoMethod *method, MonoArray *args, MonoError *error);
+
+int
+mono_runtime_try_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc, MonoError *error);
+
+
 #endif /* __MONO_OBJECT_INTERNALS_H__ */
 
 
index a9006ac4889c277a88b4f44540d6556a6739b96f..7e4c9dc4e062b84777f32afaf1ab51e5ddd3ea04 100644 (file)
@@ -4165,22 +4165,14 @@ mono_runtime_set_main_args (int argc, char* argv[])
        return 0;
 }
 
-/**
- * mono_runtime_run_main:
- * @method: the method to start the application with (usually Main)
- * @argc: number of arguments from the command line
- * @argv: array of strings from the command line
- * @exc: excetption results
- *
- * Execute a standard Main() method (argc/argv contains the
- * executable name). This method also sets the command line argument value
- * needed by System.Environment.
- *
+/*
+ * Prepare an array of arguments in order to execute a standard Main()
+ * method (argc/argv contains the executable name). This method also
+ * sets the command line argument value needed by System.Environment.
  * 
  */
-int
-mono_runtime_run_main (MonoMethod *method, int argc, char* argv[],
-                      MonoObject **exc)
+static MonoArray*
+prepare_run_main (MonoMethod *method, int argc, char *argv[])
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
@@ -4271,9 +4263,92 @@ mono_runtime_run_main (MonoMethod *method, int argc, char* argv[],
        
        mono_assembly_set_main (method->klass->image->assembly);
 
-       return mono_runtime_exec_main (method, args, exc);
+       return args;
+}
+
+/**
+ * mono_runtime_run_main:
+ * @method: the method to start the application with (usually Main)
+ * @argc: number of arguments from the command line
+ * @argv: array of strings from the command line
+ * @exc: excetption results
+ *
+ * Execute a standard Main() method (argc/argv contains the
+ * executable name). This method also sets the command line argument value
+ * needed by System.Environment.
+ *
+ * 
+ */
+int
+mono_runtime_run_main (MonoMethod *method, int argc, char* argv[],
+                      MonoObject **exc)
+{
+       MONO_REQ_GC_UNSAFE_MODE;
+
+       MonoError error;
+       MonoArray *args = prepare_run_main (method, argc, argv);
+       int res;
+       if (exc) {
+               res = mono_runtime_try_exec_main (method, args, exc, &error);
+               if (*exc == NULL && !is_ok (&error))
+                       *exc = (MonoObject*) mono_error_convert_to_exception (&error);
+               else
+                       mono_error_cleanup (&error);
+       } else {
+               res = mono_runtime_exec_main_checked (method, args, &error);
+               mono_error_raise_exception (&error); /* OK to throw, external only without a better alternative */
+       }
+       return res;
+}
+
+/**
+ * mono_runtime_run_main_checked:
+ * @method: the method to start the application with (usually Main)
+ * @argc: number of arguments from the command line
+ * @argv: array of strings from the command line
+ * @error: set on error
+ *
+ * Execute a standard Main() method (argc/argv contains the
+ * executable name). This method also sets the command line argument value
+ * needed by System.Environment.  On failure sets @error.
+ *
+ * 
+ */
+int
+mono_runtime_run_main_checked (MonoMethod *method, int argc, char* argv[],
+                              MonoError *error)
+{
+       mono_error_init (error);
+       MonoArray *args = prepare_run_main (method, argc, argv);
+       return mono_runtime_exec_main_checked (method, args, error);
+}
+
+/**
+ * mono_runtime_try_run_main:
+ * @method: the method to start the application with (usually Main)
+ * @argc: number of arguments from the command line
+ * @argv: array of strings from the command line
+ * @exc: set if Main throws an exception
+ * @error: set if Main can't be executed
+ *
+ * Execute a standard Main() method (argc/argv contains the executable
+ * name). This method also sets the command line argument value needed
+ * by System.Environment.  On failure sets @error if Main can't be
+ * executed or @exc if it threw and exception.
+ *
+ * 
+ */
+int
+mono_runtime_try_run_main (MonoMethod *method, int argc, char* argv[],
+                          MonoObject **exc, MonoError *error)
+{
+       g_assert (exc);
+       mono_error_init (error);
+       MonoArray *args = prepare_run_main (method, argc, argv);
+       return mono_runtime_try_exec_main (method, args, exc, error);
 }
 
+
 static MonoObject*
 serialize_object (MonoObject *obj, gboolean *failure, MonoObject **exc)
 {
@@ -4632,28 +4707,13 @@ mono_runtime_exec_managed_code (MonoDomain *domain,
        mono_thread_manage ();
 }
 
-/*
- * Execute a standard Main() method (args doesn't contain the
- * executable name).
- */
-int
-mono_runtime_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc)
+static void
+prepare_thread_to_exec_main (MonoDomain *domain, MonoMethod *method)
 {
-       MONO_REQ_GC_UNSAFE_MODE;
-
-       MonoError error;
-       MonoDomain *domain;
-       gpointer pa [1];
-       int rval;
+       MonoInternalThread* thread = mono_thread_internal_current ();
        MonoCustomAttrInfo* cinfo;
        gboolean has_stathread_attribute;
-       MonoInternalThread* thread = mono_thread_internal_current ();
 
-       g_assert (args);
-
-       pa [0] = args;
-
-       domain = mono_object_domain (args);
        if (!domain->entry_assembly) {
                gchar *str;
                MonoAssembly *assembly;
@@ -4673,8 +4733,9 @@ mono_runtime_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc)
                }
        }
 
-       cinfo = mono_custom_attrs_from_method_checked (method, &error);
-       mono_error_cleanup (&error); /* FIXME warn here? */
+       MonoError cattr_error;
+       cinfo = mono_custom_attrs_from_method_checked (method, &cattr_error);
+       mono_error_cleanup (&cattr_error); /* FIXME warn here? */
        if (cinfo) {
                has_stathread_attribute = mono_custom_attrs_has_attr (cinfo, mono_class_get_sta_thread_attribute_class ());
                if (!cinfo->cached)
@@ -4689,39 +4750,85 @@ mono_runtime_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc)
        }
        mono_thread_init_apartment_state ();
 
+}
+
+static int
+do_exec_main_checked (MonoMethod *method, MonoArray *args, MonoError *error)
+{
+       MONO_REQ_GC_UNSAFE_MODE;
+
+       gpointer pa [1];
+       int rval;
+
+       mono_error_init (error);
+       g_assert (args);
+
+       pa [0] = args;
+
        /* FIXME: check signature of method */
        if (mono_method_signature (method)->ret->type == MONO_TYPE_I4) {
                MonoObject *res;
-               if (exc) {
-                       res = mono_runtime_try_invoke (method, NULL, pa, exc, &error);
-                       if (*exc == NULL && !mono_error_ok (&error))
-                               *exc = (MonoObject*) mono_error_convert_to_exception (&error);
-                       else
-                               mono_error_cleanup (&error);
-               } else {
-                       res = mono_runtime_invoke_checked (method, NULL, pa, &error);
-                       mono_error_raise_exception (&error); /* FIXME don't raise here */
+               res = mono_runtime_invoke_checked (method, NULL, pa, error);
+               if (is_ok (error))
+                       rval = *(guint32 *)((char *)res + sizeof (MonoObject));
+               else
+                       rval = -1;
+               mono_environment_exitcode_set (rval);
+       } else {
+               mono_runtime_invoke_checked (method, NULL, pa, error);
+
+               if (is_ok (error))
+                       rval = 0;
+               else {
+                       /* If the return type of Main is void, only
+                        * set the exitcode if an exception was thrown
+                        * (we don't want to blow away an
+                        * explicitly-set exit code)
+                        */
+                       rval = -1;
+                       mono_environment_exitcode_set (rval);
                }
+       }
+       return rval;
+}
+
+static int
+do_try_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc, MonoError *error)
+{
+       MONO_REQ_GC_UNSAFE_MODE;
+
+       gpointer pa [1];
+       int rval;
+
+       mono_error_init (error);
+       g_assert (args);
+       g_assert (exc);
+
+       pa [0] = args;
+
+       /* FIXME: check signature of method */
+       if (mono_method_signature (method)->ret->type == MONO_TYPE_I4) {
+               MonoObject *res;
+               res = mono_runtime_try_invoke (method, NULL, pa, exc, error);
+               if (*exc == NULL && !mono_error_ok (error))
+                       *exc = (MonoObject*) mono_error_convert_to_exception (error);
+               else
+                       mono_error_cleanup (error);
 
-               if (!exc || !*exc)
+               if (*exc == NULL)
                        rval = *(guint32 *)((char *)res + sizeof (MonoObject));
                else
                        rval = -1;
 
                mono_environment_exitcode_set (rval);
        } else {
-               if (exc) {
-                       mono_runtime_try_invoke (method, NULL, pa, exc, &error);
-                       if (*exc == NULL && !mono_error_ok (&error))
-                               *exc = (MonoObject*) mono_error_convert_to_exception (&error);
-                       else
-                               mono_error_cleanup (&error);
-               } else {
-                       mono_runtime_invoke_checked (method, NULL, pa, &error);
-                       mono_error_raise_exception (&error); /* FIXME don't raise here */
-               }
+               mono_runtime_try_invoke (method, NULL, pa, exc, error);
+               if (*exc == NULL && !mono_error_ok (error))
+                       *exc = (MonoObject*) mono_error_convert_to_exception (error);
+               else
+                       mono_error_cleanup (error);
 
-               if (!exc || !*exc)
+               if (*exc == NULL)
                        rval = 0;
                else {
                        /* If the return type of Main is void, only
@@ -4737,6 +4844,59 @@ mono_runtime_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc)
        return rval;
 }
 
+/*
+ * Execute a standard Main() method (args doesn't contain the
+ * executable name).
+ */
+int
+mono_runtime_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc)
+{
+       MonoError error;
+       prepare_thread_to_exec_main (mono_object_domain (args), method);
+       if (exc) {
+               int rval = do_try_exec_main (method, args, exc, &error);
+               if (*exc == NULL && !is_ok (&error))
+                       *exc = (MonoObject*) mono_error_convert_to_exception (&error);
+               else
+                       mono_error_cleanup (&error);
+               return rval;
+       } else {
+               int rval = do_exec_main_checked (method, args, &error);
+               mono_error_raise_exception (&error); /* OK to throw, external only with no better option */
+               return rval;
+       }
+}
+
+/*
+ * Execute a standard Main() method (args doesn't contain the
+ * executable name).
+ *
+ * On failure sets @error
+ */
+int
+mono_runtime_exec_main_checked (MonoMethod *method, MonoArray *args, MonoError *error)
+{
+       mono_error_init (error);
+       prepare_thread_to_exec_main (mono_object_domain (args), method);
+       return do_exec_main_checked (method, args, error);
+}
+
+/*
+ * Execute a standard Main() method (args doesn't contain the
+ * executable name).
+ *
+ * On failure sets @error if Main couldn't be executed, or @exc if it threw an exception.
+ */
+int
+mono_runtime_try_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc, MonoError *error)
+{
+       mono_error_init (error);
+       prepare_thread_to_exec_main (mono_object_domain (args), method);
+       return do_try_exec_main (method, args, exc, error);
+}
+
+
+
 /** invoke_array_extract_argument:
  * @params: array of arguments to the method.
  * @i: the index of the argument to extract.
index 0a5a7b0bc0ff9897b4bff67481917ca192369a5b..24f7284e8e29fe365e3933622a98983951e09830 100644 (file)
@@ -279,10 +279,12 @@ mono_runtime_exec_managed_code (MonoDomain *domain,
                                MonoMainThreadFunc main_func,
                                void* main_args);
 
+MONO_RT_EXTERNAL_ONLY
 MONO_API int
 mono_runtime_run_main      (MonoMethod *method, int argc, char* argv[], 
                             MonoObject **exc);
 
+MONO_RT_EXTERNAL_ONLY
 MONO_API int
 mono_runtime_exec_main     (MonoMethod *method, MonoArray *args,
                             MonoObject **exc);
index ae1268c15222bb42c823274af45d475740a2dc0d..95bac2301bd8b5f9d0dc20e5adb70b777ebf1faf 100644 (file)
@@ -2832,12 +2832,17 @@ ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *
 }
 
 gboolean
-ves_icall_System_Net_Sockets_Socket_SupportPortReuse (void)
+ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto)
 {
 #if defined (SO_REUSEPORT) || defined (HOST_WIN32)
-    return TRUE;
+       return TRUE;
 #else
-    return FALSE;
+#ifdef __linux__
+       /* Linux always supports double binding for UDP, even on older kernels. */
+       if (proto == ProtocolType_Udp)
+               return TRUE;
+#endif
+       return FALSE;
 #endif
 }
 
index 138cc674d5b0f46410add6da353ae36c79a57deb..e228f0a2e63df038682a3d004622f541cf928284 100644 (file)
@@ -189,7 +189,7 @@ extern MonoBoolean ves_icall_System_Net_Sockets_Socket_Poll_internal (SOCKET soc
 extern void ves_icall_System_Net_Sockets_Socket_Disconnect_internal(SOCKET sock, MonoBoolean reuse, gint32 *error);
 extern gboolean ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags);
 void icall_cancel_blocking_socket_operation (MonoThread *thread);
-extern gboolean ves_icall_System_Net_Sockets_Socket_SupportPortReuse (void);
+extern gboolean ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto);
 
 extern void mono_network_init(void);
 extern void mono_network_cleanup(void);
index 1a7b15b6f55ad75f301e44531a82e8714d3c280d..9835ccc6f08b2245239554a00de8408dd45c412f 100644 (file)
@@ -1026,10 +1026,14 @@ mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[
        }
        
        if (mono_llvm_only) {
-               MonoObject *exc;
+               MonoObject *exc = NULL;
                int res;
 
-               res = mono_runtime_run_main (method, argc, argv, &exc);
+               res = mono_runtime_try_run_main (method, argc, argv, &exc, &error);
+               if (exc == NULL && !is_ok (&error))
+                       exc = (MonoObject*) mono_error_convert_to_exception (&error);
+               else
+                       mono_error_cleanup (&error);
                if (exc) {
                        mono_unhandled_exception (exc);
                        mono_invoke_unhandled_exception_hook (exc);
@@ -1037,7 +1041,9 @@ mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[
                }
                return res;
        } else {
-               return mono_runtime_run_main (method, argc, argv, NULL);
+               int res = mono_runtime_run_main_checked (method, argc, argv, &error);
+               mono_error_raise_exception (&error); /* FIXME don't raise here */
+               return res;
        }
 }
 
index ca7a3ce12b2ba071c84d3b0c1583c0cc56bf09cc..93dee86723df1fe88855b0770b1e2cc1100141e9 100644 (file)
@@ -2036,7 +2036,10 @@ emit_store_general (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builde
                args [4] = LLVMConstInt (LLVMInt32Type (), ordering, FALSE);
                emit_call (ctx, bb, builder_ref, get_intrinsic (ctx, intrins_name), args, 5);
        } else {
-               mono_llvm_build_store (*builder_ref, value, addr, is_faulting, barrier);
+               if (barrier != LLVM_BARRIER_NONE)
+                       mono_llvm_build_aligned_store (*builder_ref, value, addr, barrier, size);
+               else
+                       mono_llvm_build_store (*builder_ref, value, addr, is_faulting, barrier);
        }
 }
 
@@ -5478,9 +5481,6 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                case OP_ATOMIC_STORE_U8:
                case OP_ATOMIC_STORE_R4:
                case OP_ATOMIC_STORE_R8: {
-                       set_failure (ctx, "atomic mono.store intrinsic");
-                       break;
-#if 0
                        int size;
                        gboolean sext, zext;
                        LLVMTypeRef t;
@@ -5488,6 +5488,11 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        BarrierKind barrier = (BarrierKind) ins->backend.memory_barrier_kind;
                        LLVMValueRef index, addr, value;
 
+                       if (!cfg->llvm_only) {
+                               set_failure (ctx, "atomic mono.store intrinsic");
+                               break;
+                       }
+
                        if (!values [ins->inst_destbasereg]) {
                            set_failure (ctx, "inst_destbasereg");
                                break;
@@ -5501,7 +5506,6 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
 
                        emit_store_general (ctx, bb, &builder, size, value, addr, is_volatile, barrier);
                        break;
-#endif
                }
                case OP_RELAXED_NOP: {
 #if defined(TARGET_AMD64) || defined(TARGET_X86)