* SecurityElementTest.cs: Modified test for bug #333699 to use double
authorGert Driesen <drieseng@users.sourceforge.net>
Sun, 14 Oct 2007 14:40:10 +0000 (14:40 -0000)
committerGert Driesen <drieseng@users.sourceforge.net>
Sun, 14 Oct 2007 14:40:10 +0000 (14:40 -0000)
quote as delimiter to work around MS bug. Added test for bug #333725.

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

mcs/class/corlib/Test/System.Security/ChangeLog
mcs/class/corlib/Test/System.Security/SecurityElementTest.cs

index 8b84bc2b9f507ecc90c7cdeebbd4ce9a6891b749..0e0312cdcfa2bacdb7c21ba01b4e923ae0097f22 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-14  Gert Driesen  <drieseng@users.sourceforge.net>
+
+       * SecurityElementTest.cs: Modified test for bug #333699 to use double
+       quote as delimiter to work around MS bug. Added test for bug #333725.
+
 2007-10-14  Gert Driesen  <drieseng@users.sourceforge.net>
 
        * SecurityElementTest.cs: No longer derive from Assertion. Added and
index 70ae04c39dc807ed91f59370cdbee7b509a3055b..3a352af4957b558facdf6f06f86fc3fa2ce09db2 100644 (file)
@@ -461,7 +461,7 @@ namespace MonoTests.System.Security {
                }
                
                [Test]
-               public void SearchForTextOfTag_Null ()
+               public void SearchForTextOfTag_Tag_Null ()
                {
                        try {
                                elem.SearchForTextOfTag (null);
@@ -675,7 +675,7 @@ namespace MonoTests.System.Security {
                {
                        const string xml = @"
                                <values>
-                                       <value name='&quot;name&quot;&amp;&lt;address&gt;'>&lt;&apos;Suds&apos; &amp; &quot;Soda&quot;&gt;!</value>
+                                       <value name=""&quot;name&quot;&amp;&lt;address&gt;"">&lt;&apos;Suds&apos; &amp; &quot;Soda&quot;&gt;!</value>
                                </values>";
 
                        SecurityElement se = SecurityElement.FromString (xml);
@@ -689,11 +689,27 @@ namespace MonoTests.System.Security {
                        SecurityElement child = se.Children [0] as SecurityElement;
                        Assert.IsNotNull (child, "#B1");
                        Assert.IsNotNull (child.Attributes, "#B2");
-                       Assert.AreEqual ("'\"name\"&<address>'", child.Attribute ("name"), "#B3");
+                       Assert.AreEqual ("\"name\"&<address>", child.Attribute ("name"), "#B3");
                        Assert.AreEqual ("value", child.Tag, "#B4");
                        Assert.AreEqual ("<'Suds' & \"Soda\">!", child.Text, "#B5");
                        Assert.IsNull (child.Children, "#B6");
                }
+
+               [Test] // bug #333725
+               [Category ("NotWorking")]
+               public void FromString_CharacterReferences ()
+               {
+                       const string xml = @"
+                               <value name=""name&#38;address"">Suds&#x26;Soda&#38;</value>";
+
+                       SecurityElement se = SecurityElement.FromString (xml);
+                       Assert.IsNotNull (se, "#1");
+                       Assert.IsNotNull (se.Attributes, "#2");
+                       Assert.AreEqual ("name&#38;address", se.Attribute ("name"), "#3");
+                       Assert.AreEqual ("value", se.Tag, "#4");
+                       Assert.AreEqual ("Suds&#x26;Soda&#38;", se.Text, "#5");
+                       Assert.IsNull (se.Children, "#6");
+               }
 #endif
        }
 }