Author: gonzalo
Date: 2005-06-23 16:56:03 -0400 (Thu, 23 Jun 2005)
New Revision: 46453

Modified:
   trunk/mcs/class/System.Web/Test/System.Web/ChangeLog
   trunk/mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs
Log:
2005-06-23 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * HttpUtilityTest.cs: new tests.



Modified: trunk/mcs/class/System.Web/Test/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web/ChangeLog        2005-06-23 
20:55:20 UTC (rev 46452)
+++ trunk/mcs/class/System.Web/Test/System.Web/ChangeLog        2005-06-23 
20:56:03 UTC (rev 46453)
@@ -1,3 +1,7 @@
+2005-06-23 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+       * HttpUtilityTest.cs: new tests.
+
 2005-05-13  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * HttpUtilityTest.cs : test for url decode.

Modified: trunk/mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs       
2005-06-23 20:55:20 UTC (rev 46452)
+++ trunk/mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs       
2005-06-23 20:56:03 UTC (rev 46453)
@@ -80,5 +80,27 @@
                        Assert.AreEqual (0x25, bytes [0], "#4");
                        Assert.AreEqual (0x25, bytes [0], "#5");
                }
+
+
+               [Test]
+               public void EscapedCharacters ()
+               {
+                       for (int i = 0; i < 256; i++) {
+                               string str = new string ((char) i, 1);
+                               string encoded = HttpUtility.HtmlEncode (str);
+                               if ((i > 159 && i < 256 ) || i == '&' || i == 
'<' || i == '>' || i == '"') {
+                                       if (encoded [0] != '&' || encoded 
[encoded.Length - 1] != ';')
+                                               Assertion.Fail ("Failed for i = 
" + i);
+                               } else if (encoded.Length != 1) {
+                                       Assertion.Fail ("Wrong length for i = " 
+ i);
+                               }
+                       }
+               }
+
+               [Test]
+               public void Decode1 ()
+               {
+                       Assert.AreEqual ("\xE9", HttpUtility.HtmlDecode 
("&#233;"));
+               }
        }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to