Browse Source

* XmlTextWriterTests.cs: Fixed line endings. Enabled XmlPrefix_ValidMS
test. Added bug numbers to test cases.

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

Gert Driesen 20 years ago
parent
commit
d356e20cd7
1 changed files with 27 additions and 22 deletions
  1. 27 22
      mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs

+ 27 - 22
mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs

@@ -83,7 +83,7 @@ namespace MonoTests.System.Xml
 		}
 
 		[Test]
-		[Category ("NotWorking")]
+		[Category ("NotWorking")] // bug #77083
 		public void XmlNs_Valid2 ()
 		{
 			xtw.WriteAttributeString (null, "test", "http://www.w3.org/2000/xmlns/", "http://abc.def");
@@ -94,6 +94,14 @@ namespace MonoTests.System.Xml
 
 			xtw.WriteAttributeString ("", "test", "http://www.w3.org/2000/xmlns/", "http://abc.def");
 			Assert.AreEqual ("xmlns:test='http://abc.def'", StringWriterText, "#4");
+
+			sw.GetStringBuilder ().Length = 0;
+			CreateXmlTextWriter ();
+
+			xtw.WriteStartElement ("person");
+			xtw.WriteAttributeString ("", "test", "http://www.w3.org/2000/xmlns/", "http://abc.def");
+			xtw.WriteEndElement ();
+			Assert.AreEqual ("<person xmlns:test='http://abc.def' />", StringWriterText, "#5");
 		}
 
 		[Test]
@@ -112,10 +120,9 @@ namespace MonoTests.System.Xml
 			xtw.WriteAttributeString (null, "xmlns", "http://somenamespace.com", "http://abc.def");
 		}
 
-		// causes ArgumentException on Mono
 		[Test]
 		[Category ("NotWorking")]
-		public void XmlSpace_Valid ()
+		public void XmlSpace_Valid () // bug #77084
 		{
 			xtw.WriteAttributeString ("xml", "space", null, "preserve");
 			Assert.AreEqual ("xml:space='preserve'", StringWriterText, "#1");
@@ -124,20 +131,18 @@ namespace MonoTests.System.Xml
 			CreateXmlTextWriter ();
 
 			xtw.WriteAttributeString ("xml", "space", "whatever", "default");
-			Assert.AreEqual ("xml:space='default'", StringWriterText, "#2");
-
-			sw.GetStringBuilder ().Length = 0;
+			Assert.AreEqual ("xml:space='default'", StringWriterText, "#2");
+
+			sw.GetStringBuilder ().Length = 0;
 			CreateXmlTextWriter ();
-
-			xtw.WriteStartElement ("person");
-			xtw.WriteAttributeString ("xml", "space", "whatever", "default");
-			xtw.WriteEndElement ();
-			Assert.AreEqual ("<person xml:space='default' />", StringWriterText, "#3");
+
+			xtw.WriteStartElement ("person");
+			xtw.WriteAttributeString ("xml", "space", "whatever", "default");
+			xtw.WriteEndElement ();
+			Assert.AreEqual ("<person xml:space='default' />", StringWriterText, "#3");
 		}
 
-		// MS special cases any attribute with prefix "xml"
 		[Test]
-		[Category ("NotWorking")]
 		public void XmlPrefix_ValidMS ()
 		{
 			xtw.WriteAttributeString ("xml", "something", "whatever", "default");
@@ -147,15 +152,15 @@ namespace MonoTests.System.Xml
 			CreateXmlTextWriter ();
 
 			xtw.WriteAttributeString ("xml", "else", null, "whatever");
-			Assert.AreEqual ("xml:else='whatever'", StringWriterText, "#2");
-
-			sw.GetStringBuilder ().Length = 0;
+			Assert.AreEqual ("xml:else='whatever'", StringWriterText, "#2");
+
+			sw.GetStringBuilder ().Length = 0;
 			CreateXmlTextWriter ();
-
-			xtw.WriteStartElement ("person");
-			xtw.WriteAttributeString ("xml", "something", "whatever", "default");
-			xtw.WriteAttributeString ("xml", "else", null, "whatever");
-			xtw.WriteEndElement ();
+
+			xtw.WriteStartElement ("person");
+			xtw.WriteAttributeString ("xml", "something", "whatever", "default");
+			xtw.WriteAttributeString ("xml", "else", null, "whatever");
+			xtw.WriteEndElement ();
 			Assert.AreEqual ("<person xml:something='default' xml:else='whatever' />", 
 				StringWriterText, "#3");
 		}
@@ -203,7 +208,7 @@ namespace MonoTests.System.Xml
 		}
 
 		[Test]
-		[Category ("NotWorking")]
+		[Category ("NotWorking")] // bug #77086, #77087 and #77088
 		public void AutoCreatePrefixes ()
 		{
 			xtw.WriteAttributeString (null, "abc", "http://somenamespace.com", "http://abc.def");