2009-06-26 Robert Jordan <robertj@gmx.net>
authorRobert Jordan <robertj@gmx.net>
Fri, 26 Jun 2009 11:59:34 +0000 (11:59 -0000)
committerRobert Jordan <robertj@gmx.net>
Fri, 26 Jun 2009 11:59:34 +0000 (11:59 -0000)
* *.cs: Upgrade to new NUnit style.

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

mcs/class/System/Test/System.Net/ChangeLog
mcs/class/System/Test/System.Net/CookieCollectionTest.cs
mcs/class/System/Test/System.Net/CookieTest.cs
mcs/class/System/Test/System.Net/CredentialCacheTest.cs
mcs/class/System/Test/System.Net/HttpWebRequestTest.cs
mcs/class/System/Test/System.Net/IPEndPointTest.cs
mcs/class/System/Test/System.Net/ServicePointManagerTest.cs
mcs/class/System/Test/System.Net/ServicePointTest.cs
mcs/class/System/Test/System.Net/WebHeaderCollectionTest.cs
mcs/class/System/Test/System.Net/WebProxyTest.cs
mcs/class/System/Test/System.Net/WebRequestTest.cs

index 1ca61e686d07667b628574d53fbcb80ba4dc9930..685b60e0bcca5a885c70bf8a38738c577d0e5a80 100644 (file)
@@ -1,3 +1,7 @@
+2009-06-26  Robert Jordan  <robertj@gmx.net>
+
+       * *.cs: Upgrade to new NUnit style.
+
 2009-06-20  Gert Driesen  <drieseng@users.sourceforge.net>
 
        * HttpWebRequestTest.cs: Improved and enabled test for bug #510642.
index d94c2164115085938dbb37c9dc721a426050afb7..87d2325bb178a25b7d670b16e37521e49beebd18 100644 (file)
@@ -33,7 +33,7 @@ public class CookieCollectionTest
         [Test]\r
         public void Count ()\r
         {\r
-               Assertion.AssertEquals ("#1", col.Count, 3);\r
+               Assert.AreEqual (col.Count, 3, "#1");\r
        }\r
 \r
         [Test]\r
@@ -42,18 +42,18 @@ public class CookieCollectionTest
                Cookie c = null;\r
                try {\r
                        c = col [-1];\r
-                       Assertion.Fail ("#1");\r
+                       Assert.Fail ("#1");\r
                } catch (ArgumentOutOfRangeException) {\r
                }\r
                try {\r
                        c = col [col.Count];\r
-                       Assertion.Fail ("#2");\r
+                       Assert.Fail ("#2");\r
                } catch (ArgumentOutOfRangeException) {\r
                }\r
                c = col ["name1"];\r
-               Assertion.AssertEquals ("#3", c.Name, "name1");\r
+               Assert.AreEqual (c.Name, "name1", "#3");\r
                c = col ["NAME2"];\r
-               Assertion.AssertEquals ("#4", c.Name, "name2");\r
+               Assert.AreEqual (c.Name, "name2", "#4");\r
        }\r
        \r
         [Test]\r
@@ -62,7 +62,7 @@ public class CookieCollectionTest
                try {\r
                        Cookie c = null;\r
                        col.Add (c);\r
-                       Assertion.Fail ("#1");\r
+                       Assert.Fail ("#1");\r
                } catch (ArgumentNullException) {\r
                }\r
                \r
@@ -70,13 +70,13 @@ public class CookieCollectionTest
                // so we'll have to fail to.\r
                try {\r
                        col.Add (col);\r
-                       Assertion.Fail ("#2");\r
+                       Assert.Fail ("#2");\r
                } catch (Exception) {\r
                }\r
-               Assertion.AssertEquals ("#3", col.Count, 3);\r
+               Assert.AreEqual (col.Count, 3, "#3");\r
                \r
                col.Add (new Cookie("name1", "value1"));                \r
-               Assertion.AssertEquals ("#4", col.Count, 3);\r
+               Assert.AreEqual (col.Count, 3, "#4");\r
                \r
                CookieCollection col2 = new CookieCollection();\r
                Cookie c4 = new Cookie("name4", "value4");\r
@@ -84,9 +84,9 @@ public class CookieCollectionTest
                col2.Add (c4);\r
                col2.Add (c5);\r
                col.Add (col2);\r
-               Assertion.AssertEquals ("#5", col.Count, 5);\r
-               Assertion.AssertEquals ("#6", col ["NAME4"], c4);\r
-               Assertion.AssertEquals ("#7", col [4], c5);\r
+               Assert.AreEqual (col.Count, 5, "#5");\r
+               Assert.AreEqual (col ["NAME4"], c4, "#6");\r
+               Assert.AreEqual (col [4], c5, "#7");\r
        }\r
        \r
         [Test]\r
@@ -94,9 +94,9 @@ public class CookieCollectionTest
        {\r
                Array a = Array.CreateInstance (typeof (Cookie), 3);\r
                col.CopyTo (a, 0);\r
-               Assertion.AssertEquals ("#1", a.GetValue (0), col [0]);\r
-               Assertion.AssertEquals ("#2", a.GetValue (1), col [1]);\r
-               Assertion.AssertEquals ("#3", a.GetValue (2), col [2]);\r
+               Assert.AreEqual (a.GetValue (0), col [0], "#1");\r
+               Assert.AreEqual (a.GetValue (1), col [1], "#2");\r
+               Assert.AreEqual (a.GetValue (2), col [2], "#3");\r
        }\r
        \r
         [Test]\r
@@ -105,11 +105,11 @@ public class CookieCollectionTest
                IEnumerator enumerator = col.GetEnumerator ();\r
                enumerator.MoveNext ();\r
                Cookie c = (Cookie) enumerator.Current;\r
-               Assertion.AssertEquals ("#1", c, col [0]);\r
+               Assert.AreEqual (c, col [0], "#1");\r
                col.Add (new Cookie ("name6", "value6"));\r
                try {\r
                        enumerator.MoveNext ();\r
-                       Assertion.Fail ("#2");\r
+                       Assert.Fail ("#2");\r
                } catch (InvalidOperationException) {\r
                }\r
        }\r
index 1bd5c64848cbbe31c26ef50b04fae223ae354630..b84dedb2aab72627f0ca9448d2135f364bdf2a6c 100644 (file)
@@ -57,7 +57,7 @@ namespace MonoTests.System.Net
                        try
                        {
                                c = new Cookie (null, null, null, null);
-                               Assertion.Fail ("#1: Name cannot be null");
+                               Assert.Fail ("#1: Name cannot be null");
                        }
                        catch (CookieException)
                        {
@@ -68,44 +68,44 @@ namespace MonoTests.System.Net
                public void Name ()
                {
                        Cookie c = new Cookie ("SomeName", "SomeValue");
-                       Assertion.AssertEquals ("#1", c.Name, "SomeName");
+                       Assert.AreEqual (c.Name, "SomeName", "#1");
                        try
                        {
                                c.Name = null;
-                               Assertion.Fail ("#2a");
+                               Assert.Fail ("#2a");
                        }
                        catch (CookieException)
                        {
-                               Assertion.AssertEquals ("#2b", "SomeName", c.Name);
+                               Assert.AreEqual ("SomeName", c.Name, "#2b");
                        }
                        try
                        {
                                c.Name = "";
-                               Assertion.Fail ("#2c");
+                               Assert.Fail ("#2c");
                        }
                        catch (CookieException)
                        {
-                               Assertion.AssertEquals ("#2d", "SomeName", c.Name);
+                               Assert.AreEqual ("SomeName", c.Name, "#2d");
                        }
                        try
                        {
                                c.Name = " ";
-                               Assertion.Fail ("#2e");
+                               Assert.Fail ("#2e");
                        }
                        catch (CookieException)
                        {
                                // bah! this fails, yet the name is changed.. 
                                // inconsistent with previous test
-                               Assertion.AssertEquals ("#2f", String.Empty, c.Name);
+                               Assert.AreEqual (String.Empty, c.Name, "#2f");
                        }
                        try
                        {
                                c.Name = "xxx\r\n";
-                               Assertion.Fail ("#2g");
+                               Assert.Fail ("#2g");
                        }
                        catch (CookieException)
                        {
-                               Assertion.AssertEquals ("#2h", String.Empty, c.Name);
+                               Assert.AreEqual (String.Empty, c.Name, "#2h");
                        }
                        try
                        {
@@ -113,30 +113,30 @@ namespace MonoTests.System.Net
                        }
                        catch (CookieException)
                        {
-                               Assertion.Fail ("#2i");
+                               Assert.Fail ("#2i");
                        }
                        try
                        {
                                c.Name = "$omeName";
-                               Assertion.Fail ("#3a: Name cannot start with '$' character");
+                               Assert.Fail ("#3a: Name cannot start with '$' character");
                        }
                        catch (CookieException)
                        {
-                               Assertion.AssertEquals ("#3b", String.Empty, c.Name);
+                               Assert.AreEqual (String.Empty, c.Name, "#3b");
                        }
                        c.Name = "SomeName$";
-                       Assertion.AssertEquals ("#4", c.Name, "SomeName$");
+                       Assert.AreEqual (c.Name, "SomeName$", "#4");
                        try
                        {
                                c.Name = "Some=Name";
-                               Assertion.Fail ("#5a: Name cannot contain '=' character");
+                               Assert.Fail ("#5a: Name cannot contain '=' character");
                        }
                        catch (CookieException)
                        {
-                               Assertion.AssertEquals ("#5b", String.Empty, c.Name);
+                               Assert.AreEqual (String.Empty, c.Name, "#5b");
                        }
                        c.Name = "domain";
-                       Assertion.AssertEquals ("#6", c.Name, "domain");
+                       Assert.AreEqual (c.Name, "domain", "#6");
                }
 
                [Test]
@@ -162,16 +162,16 @@ namespace MonoTests.System.Net
                        Cookie c = new Cookie("SomeName", "SomeValue");
                        try {
                                c.Value = "Some;Value";
-                               Assertion.Fail ("#1: semicolon should not be accepted");
+                               Assert.Fail ("#1: semicolon should not be accepted");
                        } catch (CookieException) {
                        }
                        try {
                                c.Value = "Some,Value";
-                               Assertion.Fail ("#2: comma should not be accepted");
+                               Assert.Fail ("#2: comma should not be accepted");
                        } catch (CookieException) {
                        }
                        c.Value = "Some\tValue";
-                       Assertion.AssertEquals ("#3", c.Value, "Some\tValue");
+                       Assert.AreEqual (c.Value, "Some\tValue", "#3");
                        */
                }
 
@@ -182,7 +182,7 @@ namespace MonoTests.System.Net
                        try
                        {
                                c.Port = "123";
-                               Assertion.Fail ("#1: port must start and end with double quotes");
+                               Assert.Fail ("#1: port must start and end with double quotes");
                        }
                        catch (CookieException)
                        {
@@ -195,12 +195,12 @@ namespace MonoTests.System.Net
                        }
                        catch (CookieException)
                        {
-                               Assertion.Fail ("#2");
+                               Assert.Fail ("#2");
                        }
                        try
                        {
                                c.Port = "\"123;124\"";
-                               Assertion.Fail ("#3");
+                               Assert.Fail ("#3");
                        }
                        catch (CookieException)
                        {
@@ -211,7 +211,7 @@ namespace MonoTests.System.Net
                        }
                        catch (CookieException)
                        {
-                               Assertion.Fail ("#4");
+                               Assert.Fail ("#4");
                        }
                        try
                        {
@@ -219,7 +219,7 @@ namespace MonoTests.System.Net
                        }
                        catch (CookieException)
                        {
-                               Assertion.Fail ("#5");
+                               Assert.Fail ("#5");
                        }
                }
 
@@ -228,12 +228,12 @@ namespace MonoTests.System.Net
                {
                        Cookie c1 = new Cookie ("NAME", "VALUE", "PATH", "DOMAIN");
                        Cookie c2 = new Cookie ("name", "value", "path", "domain");
-                       Assertion.Assert ("#1", !c1.Equals (c2));
+                       Assert.IsTrue (!c1.Equals (c2), "#1");
                        c2.Value = "VALUE";
                        c2.Path = "PATH";
-                       Assertion.Assert ("#2", c1.Equals (c2));
+                       Assert.IsTrue (c1.Equals (c2), "#2");
                        c2.Version = 1;
-                       Assertion.Assert ("#3", !c1.Equals (c2));
+                       Assert.IsTrue (!c1.Equals (c2), "#3");
                }
 
                [Test]
index c04e44293602752ed8643e56202b8ecedf9bb3e2..a1d5f79c11a120d5d086a6ea5ebfc74f27ff65c8 100644 (file)
@@ -42,56 +42,56 @@ public class CredentialCacheTest
        \r
                try {\r
                        c.Add (new Uri("http://www.ximian.com"), "Basic", cred1);\r
-                       Assertion.Fail ("#1: should have failed");\r
+                       Assert.Fail ("#1: should have failed");\r
                } catch (ArgumentException) { }\r
 \r
                c.Add (new Uri("http://www.contoso.com/"), "**Unknown**", cred1);\r
                result = c.GetCredential (new Uri("http://www.contoso.com/"), "**Unknown**");\r
-               Assertion.AssertEquals ("#3", result, cred1);\r
+               Assert.AreEqual (result, cred1, "#3");\r
                c.Remove (new Uri("http://www.contoso.com/"), "**Unknown**");\r
                result = c.GetCredential (new Uri("http://www.contoso.com/"), "**Unknown**");\r
-               Assertion.Assert ("#4", result == null);\r
+               Assert.IsTrue (result == null, "#4");\r
 \r
                c.Add (new Uri("http://www.contoso.com/"), "**Unknown**", cred1);\r
                result = c.GetCredential (new Uri("http://www.contoso.com"), "**Unknown**");\r
-               Assertion.AssertEquals ("#5", result, cred1);\r
+               Assert.AreEqual (result, cred1, "#5");\r
                c.Remove (new Uri("http://www.contoso.com"), "**Unknown**");\r
                result = c.GetCredential (new Uri("http://www.contoso.com"), "**Unknown**");\r
-               Assertion.Assert ("#6", result == null);\r
+               Assert.IsTrue (result == null, "#6");\r
 \r
                c.Add (new Uri("http://www.contoso.com/portal/"), "**Unknown**", cred1);\r
                result = c.GetCredential (new Uri("http://www.contoso.com/portal/foo/bar.html"), "**Unknown**");\r
-               Assertion.AssertEquals ("#7", result, cred1);\r
+               Assert.AreEqual (result, cred1, "#7");\r
                c.Remove (new Uri("http://www.contoso.com"), "**Unknown**");\r
                result = c.GetCredential (new Uri("http://www.contoso.com"), "**Unknown**");\r
-               Assertion.Assert ("#8", result == null);\r
+               Assert.IsTrue (result == null, "#8");\r
 \r
                result = c.GetCredential (new Uri("http://www.contoso.com:80/portal/news/index.aspx"), "Basic");\r
-               Assertion.AssertEquals ("#9", result, cred3);\r
+               Assert.AreEqual (result, cred3, "#9");\r
 \r
                result = c.GetCredential (new Uri("http://www.contoso.com:80/portal/news/index"), "Basic");\r
-               Assertion.AssertEquals ("#10", result, cred3);\r
+               Assert.AreEqual (result, cred3, "#10");\r
 \r
                result = c.GetCredential (new Uri("http://www.contoso.com:80/portal/news/"), "Basic");\r
-               Assertion.AssertEquals ("#11", result, cred3);\r
+               Assert.AreEqual (result, cred3, "#11");\r
                \r
                result = c.GetCredential (new Uri("http://www.contoso.com:80/portal/news"), "Basic");\r
-               Assertion.AssertEquals ("#12", result, cred4);\r
+               Assert.AreEqual (result, cred4, "#12");\r
 \r
                result = c.GetCredential (new Uri("http://www.contoso.com:80/portal/ne"), "Basic");\r
-               Assertion.AssertEquals ("#13", result, cred4);\r
+               Assert.AreEqual (result, cred4, "#13");\r
 \r
                result = c.GetCredential (new Uri("http://www.contoso.com:80/portal/"), "Basic");\r
-               Assertion.AssertEquals ("#14", result, cred4);                          \r
+               Assert.AreEqual (result, cred4, "#14");                         \r
 \r
                result = c.GetCredential (new Uri("http://www.contoso.com:80/portal"), "Basic");\r
-               Assertion.AssertEquals ("#15", result, cred5);\r
+               Assert.AreEqual (result, cred5, "#15");\r
 \r
                result = c.GetCredential (new Uri("http://www.contoso.com:80/"), "Basic");\r
-               Assertion.AssertEquals ("#16", result, cred5);\r
+               Assert.AreEqual (result, cred5, "#16");\r
 \r
                result = c.GetCredential (new Uri("http://www.contoso.com"), "Basic");\r
-               Assertion.AssertEquals ("#17", result, cred5);          \r
+               Assert.AreEqual (result, cred5, "#17");         \r
 \r
                /*              \r
                IEnumerator e = c.GetEnumerator ();\r
@@ -101,22 +101,22 @@ public class CredentialCacheTest
                */\r
 #if NET_2_0\r
                result = c.GetCredential ("www.ximian.com", 80, "Basic");\r
-               Assertion.Assert ("#18", result == null);               \r
+               Assert.IsTrue (result == null, "#18");          \r
 \r
                c.Add ("www.ximian.com", 80, "Basic", cred1);\r
 \r
                try {\r
                        c.Add ("www.ximian.com", 80, "Basic", cred1);\r
-                       Assertion.Fail ("#19: should have failed");\r
+                       Assert.Fail ("#19: should have failed");\r
                } catch (ArgumentException) { }\r
 \r
                result = c.GetCredential ("www.ximian.com", 80, "Basic");\r
-               Assertion.AssertEquals ("#20", result, cred1);          \r
+               Assert.AreEqual (result, cred1, "#20");         \r
 \r
                c.Remove (new Uri("http://www.contoso.com"), "Basic");\r
                c.Add ("www.contoso.com", 80, "Basic", cred5);\r
                result = c.GetCredential (new Uri("http://www.contoso.com"), "Basic");\r
-               Assertion.Assert ("#21", result == null);               \r
+               Assert.IsTrue (result == null, "#21");          \r
 #endif\r
        }\r
 }\r
index 704914741b0144d4899854aa8e06945bc07426a6..47c3abadff46386f057aaeaafaa97c665243aef9 100644 (file)
@@ -65,7 +65,7 @@ namespace MonoTests.System.Net
                public void Sync ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
-                       Assertion.AssertNotNull ("req:If Modified Since: ", req.IfModifiedSince);
+                       Assert.IsNotNull (req.IfModifiedSince, "req:If Modified Since: ");
 
                        req.UserAgent = "MonoClient v1.0";
                        Assert.AreEqual ("User-Agent", req.Headers.GetKey (0), "#A1");
@@ -90,10 +90,10 @@ namespace MonoTests.System.Net
                        req.AddRange (50, 90);
                        req.AddRange ("bytes", 100); 
                        req.AddRange ("bytes", 100, 120);
-                       Assertion.AssertEquals ("#1", "bytes=10-,50-90,100-,100-120", req.Headers ["Range"]);
+                       Assert.AreEqual ("bytes=10-,50-90,100-,100-120", req.Headers ["Range"], "#1");
                        try {
                                req.AddRange ("bits", 2000);
-                               Assertion.Fail ("#2");
+                               Assert.Fail ("#2");
                        } catch (InvalidOperationException) {}
                }
 
@@ -141,14 +141,14 @@ namespace MonoTests.System.Net
                        req.KeepAlive = false;
                        req.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv; 1.7.6) Gecko/20050317 Firefox/1.0.2";
                        req.CookieContainer = cookies;
-                       Assertion.AssertEquals ("#01", 0, cookies.Count);
+                       Assert.AreEqual (0, cookies.Count, "#01");
                        using (HttpWebResponse res = (HttpWebResponse) req.GetResponse()) {
                                CookieCollection coll = req.CookieContainer.GetCookies (new Uri (url));
-                               Assertion.AssertEquals ("#02", 1, coll.Count);
-                               Assertion.AssertEquals ("#03", 1, res.Cookies.Count);
+                               Assert.AreEqual (1, coll.Count, "#02");
+                               Assert.AreEqual (1, res.Cookies.Count, "#03");
                                Cookie one = coll [0];
                                Cookie two = res.Cookies [0];
-                               Assertion.AssertEquals ("#04", true, object.ReferenceEquals (one, two));
+                               Assert.AreEqual (true, object.ReferenceEquals (one, two), "#04");
                        }
                }
 
@@ -172,7 +172,7 @@ namespace MonoTests.System.Net
                                stream.Write (bytes, 0, bytes.Length);
                                stream.Close ();
                                HttpWebResponse resp = (HttpWebResponse) request.GetResponse ();
-                               Assertion.AssertEquals ("StatusCode", 200, (int) resp.StatusCode);
+                               Assert.AreEqual (200, (int) resp.StatusCode, "StatusCode");
                                StreamReader sr = new StreamReader (resp.GetResponseStream (), Encoding.UTF8);
                                string x = sr.ReadToEnd ();
                                sr.Close ();
@@ -229,7 +229,7 @@ namespace MonoTests.System.Net
                                // Using StreamReader+UTF8Encoding here fails on MS runtime
                                Stream stream = resp.GetResponseStream ();
                                int nread = stream.Read (bytes, 0, 32);
-                               Assertion.AssertEquals ("#01", 16, nread);
+                               Assert.AreEqual (16, nread, "#01");
                                x = Encoding.ASCII.GetString (bytes, 0, 16);
                        } finally {
                                resp.Close ();
@@ -239,7 +239,7 @@ namespace MonoTests.System.Net
                        if (server.Error != null)
                                throw server.Error;
 
-                       Assertion.AssertEquals ("1234567890123456", x);
+                       Assert.AreEqual ("1234567890123456", x);
                }
 
                [Test]
index 990a988d4adb6fd9d93733757568a2bdc43c0c26..057041ab74e590a2c3ec5c4e1a417359a462950e 100644 (file)
@@ -41,8 +41,8 @@ public class IPEndPointTest
        [Test]
         public void PublicFields ()
         {
-                Assertion.AssertEquals ("MinPort", IPEndPoint.MinPort, MyMinPort);
-                Assertion.AssertEquals ("MaxPort", IPEndPoint.MaxPort, MyMaxPort);
+                Assert.AreEqual (IPEndPoint.MinPort, MyMinPort, "MinPort");
+                Assert.AreEqual (IPEndPoint.MaxPort, MyMaxPort, "MaxPort");
         }
 
        [Test]
@@ -50,28 +50,28 @@ public class IPEndPointTest
         {
                 try {
                         new IPEndPoint (null, 0);
-                        Assertion.Fail ("Should raise an ArgumentNullException");
+                        Assert.Fail ("Should raise an ArgumentNullException");
                 } catch (ArgumentNullException) {
                 }
                 try {
                         new IPEndPoint (ipAddress, MyMinPort - 1);
-                        Assertion.Fail ("Should raise an ArgumentOutOfRangeException #1");
+                        Assert.Fail ("Should raise an ArgumentOutOfRangeException #1");
                 } catch (ArgumentOutOfRangeException) {
                 }
                 try {
                         new IPEndPoint (ipAddress, MyMaxPort + 1);
-                        Assertion.Fail ("Should raise an ArgumentOutOfRangeException #2");
+                        Assert.Fail ("Should raise an ArgumentOutOfRangeException #2");
                 } catch (ArgumentOutOfRangeException) {
                 }
 
                 try {
                         new IPEndPoint (ip, MyMinPort -1);
-                        Assertion.Fail ("Should raise an ArgumentOutOfRangeException #3");
+                        Assert.Fail ("Should raise an ArgumentOutOfRangeException #3");
                 } catch (ArgumentOutOfRangeException) {
                 }
                 try {
                         new IPEndPoint (ip, MyMaxPort + 1);
-                        Assertion.Fail ("Should raise an ArgumentOutOfRangeException #4");
+                        Assert.Fail ("Should raise an ArgumentOutOfRangeException #4");
                 } catch (ArgumentOutOfRangeException) {
                 }
         }
@@ -81,12 +81,12 @@ public class IPEndPointTest
         {
                 try {
                         endPoint1.Port = MyMinPort - 1;
-                        Assertion.Fail ("Should raise an ArgumentOutOfRangeException #1");
+                        Assert.Fail ("Should raise an ArgumentOutOfRangeException #1");
                 } catch (ArgumentOutOfRangeException) {
                 }
                 try {
                         endPoint1.Port = MyMaxPort + 1;
-                        Assertion.Fail ("Should raise an ArgumentOutOfRangeException #2");
+                        Assert.Fail ("Should raise an ArgumentOutOfRangeException #2");
                 } catch (ArgumentOutOfRangeException) {
                 }
         }
@@ -96,34 +96,34 @@ public class IPEndPointTest
         {
                SocketAddress addr = endPoint1.Serialize ();
                EndPoint endPoint3 = endPoint2.Create (addr);
-               Assertion.Assert ("#1", endPoint1.Equals (endPoint3));
+               Assert.IsTrue (endPoint1.Equals (endPoint3), "#1");
 
                IPAddress ipAddress = IPAddress.Parse ("255.255.255.255");
                 IPEndPoint endPoint4 = new IPEndPoint (ipAddress, MyMaxPort);
                addr = endPoint4.Serialize ();
                EndPoint endPoint5 = endPoint2.Create(addr);
-               Assertion.Assert ("#2", endPoint4.Equals (endPoint5));
-               Assertion.AssertEquals ("#3", endPoint5.ToString (), "255.255.255.255:" + MyMaxPort);
+               Assert.IsTrue (endPoint4.Equals (endPoint5), "#2");
+               Assert.AreEqual (endPoint5.ToString (), "255.255.255.255:" + MyMaxPort, "#3");
        }
 
        [Test]
         public void Equals ()
         {
-                Assertion.Assert("Equals", endPoint1.Equals (endPoint2));
-                Assertion.Assert("Not Equals", !endPoint1.Equals (new IPEndPoint (ip, MyPort + 1)));
+                Assert.IsTrue (endPoint1.Equals (endPoint2), "Equals");
+                Assert.IsTrue (!endPoint1.Equals (new IPEndPoint (ip, MyPort + 1)), "Not Equals");
         }
 
        [Test]
         public void GetHashCodeTest ()
         {
-                Assertion.AssertEquals(endPoint1.GetHashCode(), endPoint2.GetHashCode());
+                Assert.AreEqual (endPoint1.GetHashCode(), endPoint2.GetHashCode());
         }
 
        [Test]
         public void ToStringTest ()
         {
-                Assertion.AssertEquals("ToString #1", endPoint1.ToString (), MyIPAddressString + ":" + MyPort);
-                Assertion.AssertEquals("ToString #2", endPoint2.ToString (), MyIPAddressString + ":" + MyPort);
+                Assert.AreEqual (endPoint1.ToString (), MyIPAddressString + ":" + MyPort, "ToString #1");
+                Assert.AreEqual (endPoint2.ToString (), MyIPAddressString + ":" + MyPort, "ToString #2");
         }
 
 }
index a866fb5d41b5809de2aff7ee415e09886f68995d..fe2f075b32e72d1251b568c6c72d9c184271ec07 100644 (file)
@@ -19,7 +19,7 @@ namespace MonoTests.System.Net
 {\r
 \r
 [TestFixture]\r
-public class ServicePointManagerTest : Assertion\r
+public class ServicePointManagerTest\r
 {\r
        private Uri googleUri;\r
        private Uri yahooUri;\r
@@ -49,7 +49,7 @@ public class ServicePointManagerTest : Assertion
 #endif\r
         public void MaxServicePointManagers ()\r
         {\r
-               AssertEquals ("#1", 0, ServicePointManager.MaxServicePoints);\r
+               Assert.AreEqual (0, ServicePointManager.MaxServicePoints, "#1");\r
                \r
                DoWebRequest (googleUri);\r
                Thread.Sleep (100);\r
@@ -89,9 +89,9 @@ public class ServicePointManagerTest : Assertion
        {\r
                ServicePointManager.MaxServicePoints = 0;\r
                ServicePoint sp = ServicePointManager.FindServicePoint (googleUri, new WebProxy (apacheUri));\r
-               AssertEquals ("#1", apacheUri, sp.Address);\r
-               AssertEquals ("#2", 2, sp.ConnectionLimit);\r
-               AssertEquals ("#3", "http", sp.ConnectionName);\r
+               Assert.AreEqual (apacheUri, sp.Address, "#1");\r
+               Assert.AreEqual (2, sp.ConnectionLimit, "#2");\r
+               Assert.AreEqual ("http", sp.ConnectionName, "#3");\r
        }\r
        \r
        private void DoWebRequest (Uri uri)\r
index 2a8983776d152831e3415fb45eae8d996281eeda..457dc5b29f1ec4e1daeb3553b813d97e0f23d5a9 100644 (file)
@@ -47,7 +47,7 @@ public class ServicePointTest
                ServicePoint google = ServicePointManager.FindServicePoint (new Uri ("http://www.google.com"));\r
                try {                   \r
                        ServicePoint slashdot = ServicePointManager.FindServicePoint (new Uri ("http://www.slashdot.org"));\r
-                       Assertion.Fail ("#1");\r
+                       Assert.Fail ("#1");\r
                } catch (InvalidOperationException) { }\r
                ServicePointManager.MaxServicePoints = 0;\r
                \r
@@ -58,7 +58,7 @@ public class ServicePointTest
                \r
                //WriteServicePoint ("google after getting a response", google);\r
                ServicePoint google2 = ServicePointManager.FindServicePoint (new Uri ("http://www.google.com/dilbert.html"));\r
-               Assertion.AssertEquals ("#equals", google, google2);\r
+               Assert.AreEqual (google, google2, "#equals");\r
                res.Close ();\r
                \r
                // in both instances property CurrentConnections is 0 according to ms.net.\r
@@ -168,27 +168,27 @@ public class ServicePointTest
                bool called = false;\r
 #if !TARGET_JVM\r
                sp.BindIPEndPointDelegate = delegate {\r
-                       Assertion.Assert(!called);\r
+                       Assert.IsTrue (!called);\r
                        called = true;\r
                        return null;\r
                };\r
 #endif\r
                req.GetResponse ().Close ();\r
 \r
-               Assertion.Assert (called);\r
+               Assert.IsTrue (called);\r
 \r
                req = (HttpWebRequest) WebRequest.Create (uri);\r
                called = false;\r
 #if !TARGET_JVM\r
                sp.BindIPEndPointDelegate = delegate(ServicePoint point, IPEndPoint remote, int times) {\r
-                       Assertion.Assert(times < 5);\r
+                       Assert.IsTrue (times < 5);\r
                        called = true;\r
                        return new IPEndPoint(IPAddress.Parse("0.0.0.0"), 12345 + times);\r
                };\r
 #endif\r
                req.GetResponse ().Close ();\r
 \r
-               Assertion.Assert(called);\r
+               Assert.IsTrue (called);\r
        }\r
 #endif\r
 \r
index 8d335903796e9725dfb555cf8d014169a5296086..384ba0eaf3e01e13eacee74ea42959b519c989fc 100644 (file)
@@ -40,44 +40,44 @@ namespace MonoTests.System.Net
                {
                        try {
                                col.Add (null);
-                               Assertion.Fail ("#1");
+                               Assert.Fail ("#1");
                        } catch (ArgumentNullException) { }
                        try {
                                col.Add ("");
-                               Assertion.Fail ("#2");
+                               Assert.Fail ("#2");
                        } catch (ArgumentException) { }
                        try {
                                col.Add ("  ");
-                               Assertion.Fail ("#3");
+                               Assert.Fail ("#3");
                        } catch (ArgumentException) { }
                        try {
                                col.Add (":");
-                               Assertion.Fail ("#4");
+                               Assert.Fail ("#4");
                        } catch (ArgumentException) { }
                        try {
                                col.Add (" : ");
-                               Assertion.Fail ("#5");
+                               Assert.Fail ("#5");
                        } catch (ArgumentException) { }
 
                        try {
                                col.Add ("XHost: foo");
                        } catch (ArgumentException) {
-                               Assertion.Fail ("#7");
+                               Assert.Fail ("#7");
                        }
 
                        // invalid values
                        try {
                                col.Add ("XHost" + ((char) 0xa9) + ": foo");
-                               Assertion.Fail ("#8");
+                               Assert.Fail ("#8");
                        } catch (ArgumentException) { }
                        try {
                                col.Add ("XHost: foo" + (char) 0xa9);
                        } catch (ArgumentException) {
-                               Assertion.Fail ("#9");
+                               Assert.Fail ("#9");
                        }
                        try {
                                col.Add ("XHost: foo" + (char) 0x7f);
-                               Assertion.Fail ("#10");
+                               Assert.Fail ("#10");
                        } catch (ArgumentException) {
 
                        }
@@ -85,12 +85,12 @@ namespace MonoTests.System.Net
                        try {
                                col.Add ("XHost", null);
                        } catch (ArgumentException) {
-                               Assertion.Fail ("#11");
+                               Assert.Fail ("#11");
                        }
                        try {
                                col.Add ("XHost:");
                        } catch (ArgumentException) {
-                               Assertion.Fail ("#12");
+                               Assert.Fail ("#12");
                        }
 
                        // restricted
@@ -99,7 +99,7 @@ namespace MonoTests.System.Net
                        try {
                                WebHeaderCollection col2 = new WebHeaderCollection (true);
                                col2.Add ("Host: foo");
-                               Assertion.Fail ("#13: should fail according to spec");
+                               Assert.Fail ("#13: should fail according to spec");
                        } catch (ArgumentException) {}          
                        */
                }
@@ -114,61 +114,61 @@ namespace MonoTests.System.Net
                        w.Add ("Hello", "H3,H4");
 
                        string [] sa = w.GetValues ("Hello");
-                       Assertion.AssertEquals ("#1", 3, sa.Length);
-                       Assertion.AssertEquals ("#2", "H1,H2,H3,H4", w.Get ("Hello"));
+                       Assert.AreEqual (3, sa.Length, "#1");
+                       Assert.AreEqual ("H1, H2,H3,H4", w.Get ("Hello"), "#2");
 
                        w = new WebHeaderCollection ();
                        w.Add ("Accept", "H1");
                        w.Add ("Accept", "H2");
                        w.Add ("Accept", "H3,H4");
-                       Assertion.AssertEquals ("#3a", 3, w.GetValues (0).Length);
-                       Assertion.AssertEquals ("#3b", 4, w.GetValues ("Accept").Length);
-                       Assertion.AssertEquals ("#4", "H1,H2,H3,H4", w.Get ("Accept"));
+                       Assert.AreEqual (3, w.GetValues (0).Length, "#3a");
+                       Assert.AreEqual (4, w.GetValues ("Accept").Length, "#3b");
+                       Assert.AreEqual ("H1, H2,H3,H4", w.Get ("Accept"), "#4");
 
                        w = new WebHeaderCollection ();
                        w.Add ("Allow", "H1");
                        w.Add ("Allow", "H2");
                        w.Add ("Allow", "H3,H4");
                        sa = w.GetValues ("Allow");
-                       Assertion.AssertEquals ("#5", 4, sa.Length);
-                       Assertion.AssertEquals ("#6", "H1,H2,H3,H4", w.Get ("Allow"));
+                       Assert.AreEqual (4, sa.Length, "#5");
+                       Assert.AreEqual ("H1, H2,H3,H4", w.Get ("Allow"), "#6");
 
                        w = new WebHeaderCollection ();
                        w.Add ("AUTHorization", "H1, H2, H3");
                        sa = w.GetValues ("authorization");
-                       Assertion.AssertEquals ("#9", 3, sa.Length);
+                       Assert.AreEqual (3, sa.Length, "#9");
 
                        w = new WebHeaderCollection ();
                        w.Add ("proxy-authenticate", "H1, H2, H3");
                        sa = w.GetValues ("Proxy-Authenticate");
-                       Assertion.AssertEquals ("#9", 3, sa.Length);
+                       Assert.AreEqual (3, sa.Length, "#9");
 
                        w = new WebHeaderCollection ();
                        w.Add ("expect", "H1,\tH2,   H3  ");
                        sa = w.GetValues ("EXPECT");
-                       Assertion.AssertEquals ("#10", 3, sa.Length);
-                       Assertion.AssertEquals ("#11", "H2", sa [1]);
-                       Assertion.AssertEquals ("#12", "H3", sa [2]);
+                       Assert.AreEqual (3, sa.Length, "#10");
+                       Assert.AreEqual ("H2", sa [1], "#11");
+                       Assert.AreEqual ("H3", sa [2], "#12");
 
                        try {
                                w.GetValues (null);
-                               Assertion.Fail ("#13");
+                               Assert.Fail ("#13");
                        } catch (ArgumentNullException) { }
-                       Assertion.AssertEquals ("#14", null, w.GetValues (""));
-                       Assertion.AssertEquals ("#15", null, w.GetValues ("NotExistent"));
+                       Assert.AreEqual (null, w.GetValues (""), "#14");
+                       Assert.AreEqual (null, w.GetValues ("NotExistent"), "#15");
                }
 
                [Test]
                public void Indexers ()
                {
 #if NET_2_0
-               Assertion.AssertEquals ("#1.1", "Value1", ((NameValueCollection)col)[0]);
+               Assert.AreEqual ("Value1", ((NameValueCollection)col)[0], "#1.1");
                //FIXME: test also HttpRequestHeader and HttpResponseHeader
 #else
-                       Assertion.AssertEquals ("#1", "Value1", col [0]);
+                       Assert.AreEqual ("Value1", col [0], "#1");
 #endif
-                       Assertion.AssertEquals ("#2", "Value1", col ["Name1"]);
-                       Assertion.AssertEquals ("#3", "Value1", col ["NAME1"]);
+                       Assert.AreEqual ("Value1", col ["Name1"], "#2");
+                       Assert.AreEqual ("Value1", col ["NAME1"], "#3");
                }
 
                [Test]
@@ -176,7 +176,7 @@ namespace MonoTests.System.Net
                {
                        col.Remove ("Name1");
                        col.Remove ("NameNotExist");
-                       Assertion.AssertEquals ("#1", 1, col.Count);
+                       Assert.AreEqual (1, col.Count, "#1");
 
                        /*
                        // this can only be tested in namespace System.Net
@@ -184,7 +184,7 @@ namespace MonoTests.System.Net
                                WebHeaderCollection col2 = new WebHeaderCollection (true);
                                col2.Add ("Host", "foo");
                                col2.Remove ("Host");
-                               Assertion.Fail ("#2: should fail according to spec");
+                               Assert.Fail ("#2: should fail according to spec");
                        } catch (ArgumentException) {}
                        */
                }
@@ -194,19 +194,19 @@ namespace MonoTests.System.Net
                {
                        col.Add ("Name1", "Value1b");
                        col.Set ("Name1", "\t  X  \t");
-                       Assertion.AssertEquals ("#1", "X", col.Get ("Name1"));
+                       Assert.AreEqual ("X", col.Get ("Name1"), "#1");
                }
 
                [Test]
                public void IsRestricted ()
                {
-                       Assertion.Assert ("#1", !WebHeaderCollection.IsRestricted ("Xhost"));
-                       Assertion.Assert ("#2", WebHeaderCollection.IsRestricted ("Host"));
-                       Assertion.Assert ("#3", WebHeaderCollection.IsRestricted ("HOST"));
-                       Assertion.Assert ("#4", WebHeaderCollection.IsRestricted ("Transfer-Encoding"));
-                       Assertion.Assert ("#5", WebHeaderCollection.IsRestricted ("user-agent"));
-                       Assertion.Assert ("#6", WebHeaderCollection.IsRestricted ("accept"));
-                       Assertion.Assert ("#7", !WebHeaderCollection.IsRestricted ("accept-charset"));
+                       Assert.IsTrue (!WebHeaderCollection.IsRestricted ("Xhost"), "#1");
+                       Assert.IsTrue (WebHeaderCollection.IsRestricted ("Host"), "#2");
+                       Assert.IsTrue (WebHeaderCollection.IsRestricted ("HOST"), "#3");
+                       Assert.IsTrue (WebHeaderCollection.IsRestricted ("Transfer-Encoding"), "#4");
+                       Assert.IsTrue (WebHeaderCollection.IsRestricted ("user-agent"), "#5");
+                       Assert.IsTrue (WebHeaderCollection.IsRestricted ("accept"), "#6");
+                       Assert.IsTrue (!WebHeaderCollection.IsRestricted ("accept-charset"), "#7");
                }
 
                [Test]
@@ -215,7 +215,7 @@ namespace MonoTests.System.Net
                        col.Add ("Name1", "Value1b");
                        col.Add ("Name3", "Value3a\r\n Value3b");
                        col.Add ("Name4", "   Value4   ");
-                       Assertion.AssertEquals ("#1", "Name1: Value1,Value1b\r\nName2: Value2\r\nName3: Value3a\r\n Value3b\r\nName4: Value4\r\n\r\n", col.ToString ());
+                       Assert.AreEqual ("Name1: Value1,Value1b\r\nName2: Value2\r\nName3: Value3a\r\n Value3b\r\nName4: Value4\r\n\r\n", col.ToString (), "#1");
                }
 
                [Test]
index a73883adff941fcf70ede0695c50e32e81c2cd0d..49c7bbd7c93f229397cc09ab0f5eb2f8411d7917 100644 (file)
@@ -29,38 +29,38 @@ namespace MonoTests.System.Net
                public void Constructors ()
                {
                        WebProxy p = new WebProxy ();
-                       Assertion.Assert ("#1", p.Address == null);
-                       Assertion.AssertEquals ("#2", 0, p.BypassArrayList.Count);
-                       Assertion.AssertEquals ("#3", 0, p.BypassList.Length);
-                       Assertion.AssertEquals ("#4", false, p.BypassProxyOnLocal);
+                       Assert.IsTrue (p.Address == null, "#1");
+                       Assert.AreEqual (0, p.BypassArrayList.Count, "#2");
+                       Assert.AreEqual (0, p.BypassList.Length, "#3");
+                       Assert.AreEqual (false, p.BypassProxyOnLocal, "#4");
                        try {
                                p.BypassList = null;
-                               Assertion.Fail ("#5 not spec'd, but should follow ms.net implementation");
+                               Assert.Fail ("#5 not spec'd, but should follow ms.net implementation");
                        } catch (ArgumentNullException) { }
 
                        p = new WebProxy ("webserver.com", 8080);
-                       Assertion.AssertEquals ("#6", new Uri ("http://webserver.com:8080/"), p.Address);
+                       Assert.AreEqual (new Uri ("http://webserver.com:8080/"), p.Address, "#6");
 
                        p = new WebProxy ("webserver");
-                       Assertion.AssertEquals ("#7", new Uri ("http://webserver"), p.Address);
+                       Assert.AreEqual (new Uri ("http://webserver"), p.Address, "#7");
 
                        p = new WebProxy ("webserver.com");
-                       Assertion.AssertEquals ("#8", new Uri ("http://webserver.com"), p.Address);
+                       Assert.AreEqual (new Uri ("http://webserver.com"), p.Address, "#8");
 
                        p = new WebProxy ("http://webserver.com");
-                       Assertion.AssertEquals ("#9", new Uri ("http://webserver.com"), p.Address);
+                       Assert.AreEqual (new Uri ("http://webserver.com"), p.Address, "#9");
 
                        p = new WebProxy ("file://webserver");
-                       Assertion.AssertEquals ("#10", new Uri ("file://webserver"), p.Address);
+                       Assert.AreEqual (new Uri ("file://webserver"), p.Address, "#10");
 
                        p = new WebProxy ("http://www.contoso.com", true, null, null);
-                       Assertion.AssertEquals ("#11", 0, p.BypassList.Length);
-                       Assertion.AssertEquals ("#12", 0, p.BypassArrayList.Count);
+                       Assert.AreEqual (0, p.BypassList.Length, "#11");
+                       Assert.AreEqual (0, p.BypassArrayList.Count, "#12");
 
                        try {
                                p = new WebProxy ("http://contoso.com", true,
                                        new string [] { "?^!@#$%^&}{][" }, null);
-                               Assertion.Fail ("#13: illegal regular expression");
+                               Assert.Fail ("#13: illegal regular expression");
                        } catch (ArgumentException) {
                        }
                }
@@ -74,24 +74,24 @@ namespace MonoTests.System.Net
                        WebProxy p = new WebProxy (proxy1, true);
                        p.BypassArrayList.Add ("http://proxy2.contoso.com");
                        p.BypassArrayList.Add ("http://proxy2.contoso.com");
-                       Assertion.AssertEquals ("#1", 2, p.BypassList.Length);
-                       Assertion.Assert ("#2", !p.IsBypassed (new Uri ("http://www.google.com")));
-                       Assertion.Assert ("#3", p.IsBypassed (proxy2));
-                       Assertion.AssertEquals ("#4", proxy2, p.GetProxy (proxy2));
+                       Assert.AreEqual (2, p.BypassList.Length, "#1");
+                       Assert.IsTrue (!p.IsBypassed (new Uri ("http://www.google.com")), "#2");
+                       Assert.IsTrue (p.IsBypassed (proxy2), "#3");
+                       Assert.AreEqual (proxy2, p.GetProxy (proxy2), "#4");
 
                        p.BypassArrayList.Add ("?^!@#$%^&}{][");
-                       Assertion.AssertEquals ("#10", 3, p.BypassList.Length);
+                       Assert.AreEqual (3, p.BypassList.Length, "#10");
                        try {
-                               Assertion.Assert ("#11", !p.IsBypassed (proxy2));
-                               Assertion.Assert ("#12", !p.IsBypassed (new Uri ("http://www.x.com")));
-                               Assertion.AssertEquals ("#13", proxy1, p.GetProxy (proxy2));
+                               Assert.IsTrue (!p.IsBypassed (proxy2), "#11");
+                               Assert.IsTrue (!p.IsBypassed (new Uri ("http://www.x.com")), "#12");
+                               Assert.AreEqual (proxy1, p.GetProxy (proxy2), "#13");
                                // hmm... although #11 and #13 succeeded before (#3 resp. #4), 
                                // it now fails to bypass, and the IsByPassed and GetProxy 
                                // methods do not fail.. so when an illegal regular 
                                // expression is added through this property it's ignored. 
                                // probably an ms.net bug?? :(
                        } catch (ArgumentException) {
-                               Assertion.Fail ("#15: illegal regular expression");
+                               Assert.Fail ("#15: illegal regular expression");
                        }
                }
 
@@ -104,23 +104,23 @@ namespace MonoTests.System.Net
                        WebProxy p = new WebProxy (proxy1, true);
                        try {
                                p.BypassList = new string [] { "http://proxy2.contoso.com", "?^!@#$%^&}{][" };
-                               Assertion.Fail ("#1");
+                               Assert.Fail ("#1");
                        } catch (ArgumentException) {
                                // weird, this way invalid regex's fail again..
                        }
 
-                       Assertion.AssertEquals ("#2", 2, p.BypassList.Length);
+                       Assert.AreEqual (2, p.BypassList.Length, "#2");
                        // but it did apparenly store the regex's !
 
                        p.BypassList = new string [] { "http://www.x.com" };
-                       Assertion.AssertEquals ("#3", 1, p.BypassList.Length);
+                       Assert.AreEqual (1, p.BypassList.Length, "#3");
 
                        try {
                                p.BypassList = null;
-                               Assertion.Fail ("#4");
+                               Assert.Fail ("#4");
                        } catch (ArgumentNullException) { }
 
-                       Assertion.AssertEquals ("#4", 1, p.BypassList.Length);
+                       Assert.AreEqual (1, p.BypassList.Length, "#4");
                }
 
                [Test]
@@ -132,42 +132,42 @@ namespace MonoTests.System.Net
                public void IsByPassed ()
                {
                        WebProxy p = new WebProxy ("http://proxy.contoso.com", true);
-                       Assertion.Assert ("#1", !p.IsBypassed (new Uri ("http://www.google.com")));
-                       Assertion.Assert ("#2", p.IsBypassed (new Uri ("http://localhost/index.html")));
-                       Assertion.Assert ("#3", p.IsBypassed (new Uri ("http://localhost:8080/index.html")));
-                       Assertion.Assert ("#4", p.IsBypassed (new Uri ("http://loopback:8080/index.html")));
-                       Assertion.Assert ("#5", p.IsBypassed (new Uri ("http://127.0.0.01:8080/index.html")));
-                       Assertion.Assert ("#6", p.IsBypassed (new Uri ("http://webserver/index.html")));
-                       Assertion.Assert ("#7", !p.IsBypassed (new Uri ("http://webserver.com/index.html")));
+                       Assert.IsTrue (!p.IsBypassed (new Uri ("http://www.google.com")), "#1");
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://localhost/index.html")), "#2");
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://localhost:8080/index.html")), "#3");
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://loopback:8080/index.html")), "#4");
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://127.0.0.01:8080/index.html")), "#5");
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://webserver/index.html")), "#6");
+                       Assert.IsTrue (!p.IsBypassed (new Uri ("http://webserver.com/index.html")), "#7");
 
                        p = new WebProxy ("http://proxy.contoso.com", false);
-                       Assertion.Assert ("#11", !p.IsBypassed (new Uri ("http://www.google.com")));
-                       Assertion.Assert ("#12: lamespec of ms.net", p.IsBypassed (new Uri ("http://localhost/index.html")));
-                       Assertion.Assert ("#13: lamespec of ms.net", p.IsBypassed (new Uri ("http://localhost:8080/index.html")));
-                       Assertion.Assert ("#14: lamespec of ms.net", p.IsBypassed (new Uri ("http://loopback:8080/index.html")));
-                       Assertion.Assert ("#15: lamespec of ms.net", p.IsBypassed (new Uri ("http://127.0.0.01:8080/index.html")));
-                       Assertion.Assert ("#16", !p.IsBypassed (new Uri ("http://webserver/index.html")));
+                       Assert.IsTrue (!p.IsBypassed (new Uri ("http://www.google.com")), "#11");
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://localhost/index.html")), "#12: lamespec of ms.net");
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://localhost:8080/index.html")), "#13: lamespec of ms.net");
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://loopback:8080/index.html")), "#14: lamespec of ms.net");
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://127.0.0.01:8080/index.html")), "#15: lamespec of ms.net");
+                       Assert.IsTrue (!p.IsBypassed (new Uri ("http://webserver/index.html")), "#16");
 
                        p.BypassList = new string [] { "google.com", "contoso.com" };
-                       Assertion.Assert ("#20", p.IsBypassed (new Uri ("http://www.google.com")));
-                       Assertion.Assert ("#21", p.IsBypassed (new Uri ("http://www.GOOGLE.com")));
-                       Assertion.Assert ("#22", p.IsBypassed (new Uri ("http://www.contoso.com:8080/foo/bar/index.html")));
-                       Assertion.Assert ("#23", !p.IsBypassed (new Uri ("http://www.contoso2.com:8080/foo/bar/index.html")));
-                       Assertion.Assert ("#24", !p.IsBypassed (new Uri ("http://www.foo.com:8080/contoso.com.html")));
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://www.google.com")), "#20");
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://www.GOOGLE.com")), "#21");
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://www.contoso.com:8080/foo/bar/index.html")), "#22");
+                       Assert.IsTrue (!p.IsBypassed (new Uri ("http://www.contoso2.com:8080/foo/bar/index.html")), "#23");
+                       Assert.IsTrue (!p.IsBypassed (new Uri ("http://www.foo.com:8080/contoso.com.html")), "#24");
 
                        p.BypassList = new string [] { "https" };
-                       Assertion.Assert ("#30", !p.IsBypassed (new Uri ("http://www.google.com")));
-                       Assertion.Assert ("#31", p.IsBypassed (new Uri ("https://www.google.com")));
+                       Assert.IsTrue (!p.IsBypassed (new Uri ("http://www.google.com")), "#30");
+                       Assert.IsTrue (p.IsBypassed (new Uri ("https://www.google.com")), "#31");
                }
 
                [Test]
                public void IsByPassed_Address_Null ()
                {
                        WebProxy p = new WebProxy ((Uri) null, false);
-                       Assertion.Assert ("#1", p.IsBypassed (new Uri ("http://www.google.com")));
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://www.google.com")), "#1");
 
                        p = new WebProxy ((Uri) null, true);
-                       Assertion.Assert ("#2", p.IsBypassed (new Uri ("http://www.google.com")));
+                       Assert.IsTrue (p.IsBypassed (new Uri ("http://www.google.com")), "#2");
                }
 
                [Test]
@@ -179,7 +179,7 @@ namespace MonoTests.System.Net
                        WebProxy p = new WebProxy ("http://proxy.contoso.com", true);
                        try {
                                p.IsBypassed (null);
-                               Assertion.Fail ("#A1");
+                               Assert.Fail ("#A1");
 #if NET_2_0
                        } catch (ArgumentNullException ex) {
                                Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#A2");
@@ -196,7 +196,7 @@ namespace MonoTests.System.Net
                        p = new WebProxy ((Uri) null);
                        try {
                                p.IsBypassed (null);
-                               Assertion.Fail ("#B1");
+                               Assert.Fail ("#B1");
 #if NET_2_0
                        } catch (ArgumentNullException ex) {
                                Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#B2");
@@ -213,7 +213,7 @@ namespace MonoTests.System.Net
                        p = new WebProxy ((Uri) null, true);
                        try {
                                p.IsBypassed (null);
-                               Assertion.Fail ("#C1");
+                               Assert.Fail ("#C1");
 #if NET_2_0
                        } catch (ArgumentNullException ex) {
                                Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#C2");
index 4b5c176e3bdb7db296a0c6311c48782d7ec41355..636a88d19b36094691cd6842e98626d48bab86af 100644 (file)
@@ -202,41 +202,41 @@ namespace MonoTests.System.Net {
        public void All ()\r
        {\r
                WebRequest req = WebRequest.Create ("http://www.contoso.com");\r
-               Assertion.Assert ("#1", req is HttpWebRequest);\r
+               Assert.IsTrue (req is HttpWebRequest, "#1");\r
                req = WebRequest.Create ("https://www.contoso.com");\r
-               Assertion.Assert ("#2", req is HttpWebRequest);\r
+               Assert.IsTrue (req is HttpWebRequest, "#2");\r
                req = WebRequest.Create ("file://www.contoso.com");\r
-               Assertion.Assert ("#3", req is FileWebRequest);\r
+               Assert.IsTrue (req is FileWebRequest, "#3");\r
 #if NET_2_0\r
                req = WebRequest.Create ("ftp://www.contoso.com");\r
-               Assertion.Assert ("#4", req is FtpWebRequest);\r
+               Assert.IsTrue (req is FtpWebRequest, "#4");\r
 #endif\r
                WebRequest.RegisterPrefix ("http://www.contoso.com", new TestWebRequestCreator ());\r
                bool ret = WebRequest.RegisterPrefix ("http://WWW.contoso.com", new TestWebRequestCreator ());\r
-               Assertion.AssertEquals ("#5a", false, ret);\r
+               Assert.AreEqual (false, ret, "#5a");\r
                ret = WebRequest.RegisterPrefix ("http://www.contoso.com/foo/bar", new TestWebRequestCreator2 ());\r
-               Assertion.AssertEquals ("#5b", true, ret);\r
+               Assert.AreEqual (true, ret, "#5b");\r
                ret = WebRequest.RegisterPrefix ("http://www", new TestWebRequestCreator3 ());\r
-               Assertion.AssertEquals ("#5c", true, ret);\r
+               Assert.AreEqual (true, ret, "#5c");\r
 \r
                req = WebRequest.Create ("http://WWW.contoso.com");\r
-               Assertion.Assert ("#6", req is TestWebRequest); \r
+               Assert.IsTrue (req is TestWebRequest, "#6"); \r
 \r
                req = WebRequest.Create ("http://WWW.contoso.com/foo/bar/index.html");\r
-               Assertion.Assert ("#7", req is TestWebRequest2); \r
+               Assert.IsTrue (req is TestWebRequest2, "#7"); \r
                \r
                req = WebRequest.Create ("http://WWW.x.com");\r
-               Assertion.Assert ("#8", req is TestWebRequest3); \r
+               Assert.IsTrue (req is TestWebRequest3, "#8"); \r
 \r
                req = WebRequest.Create ("http://WWW.c");\r
-               Assertion.Assert ("#9", req is TestWebRequest3); \r
+               Assert.IsTrue (req is TestWebRequest3, "#9"); \r
 \r
                req = WebRequest.CreateDefault (new Uri("http://WWW.contoso.com"));\r
-               Assertion.Assert ("#10", req is HttpWebRequest);\r
+               Assert.IsTrue (req is HttpWebRequest, "#10");\r
 \r
                try {\r
                        req = WebRequest.Create ("tcp://www.contoso.com");\r
-                       Assertion.Fail ("#11 should have failed with NotSupportedException");\r
+                       Assert.Fail ("#11 should have failed with NotSupportedException");\r
                } catch (NotSupportedException) {\r
                }\r
        }\r