瀏覽代碼

Make XmlWriterSettingsTests .net compatible

Marek Safar 13 年之前
父節點
當前提交
9215ddf7ad

+ 1 - 2
mcs/class/System.XML/System.Xml/XmlWriterSettings.cs

@@ -83,8 +83,7 @@ namespace System.Xml
 			encoding = Encoding.UTF8;
 			indent = false;
 			indentChars = "  ";
-			// LAMESPEC: MS.NET says it is "\r\n", but it is silly decision.
-			newLineChars = Environment.NewLine;
+			newLineChars = "\r\n";
 			newLineOnAttributes = false;
 			newLineHandling = NewLineHandling.Replace;
 			omitXmlDeclaration = false;

+ 2 - 2
mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorTests.cs

@@ -608,8 +608,8 @@ namespace MonoTests.System.Xml
 			XPathNavigator nav = doc.CreateNavigator ();
 			XPathNodeIterator iter = nav.Select ("/Abc/Foo");
 			iter.MoveNext ();
-			Assert.AreEqual ("Hello<" + Environment.NewLine + "InnerXml", iter.Current.InnerXml, "#1");
-			Assert.AreEqual ("<Foo>Hello&lt;" + Environment.NewLine + "InnerXml</Foo>", iter.Current.OuterXml, "#2");
+			Assert.AreEqual ("Hello&lt;\r\nInnerXml", iter.Current.InnerXml, "#1");
+			Assert.AreEqual ("<Foo>Hello&lt;\r\nInnerXml</Foo>", iter.Current.OuterXml, "#2");
 			iter = nav.Select ("/Abc/Foo/text()");
 			iter.MoveNext ();
 			Assert.AreEqual (String.Empty, iter.Current.InnerXml, "#3");

+ 5 - 1
mcs/class/System.XML/Test/System.Xml/XmlWriterSettingsTests.cs

@@ -37,9 +37,13 @@ namespace MonoTests.System.Xml
 			Assert.AreEqual (Encoding.UTF8, s.Encoding);
 			Assert.AreEqual (false, s.Indent);
 			Assert.AreEqual ("  ", s.IndentChars);
-			Assert.AreEqual (Environment.NewLine, s.NewLineChars);
+			Assert.AreEqual ("\r\n", s.NewLineChars);
 			Assert.AreEqual (false, s.NewLineOnAttributes);
 			Assert.AreEqual (false, s.OmitXmlDeclaration);
+			Assert.AreEqual (NewLineHandling.Replace, s.NewLineHandling);
+#if NET_4_5
+			Assert.IsFalse (s.Async);
+#endif
 		}
 
 		[Test]

+ 0 - 2
mcs/class/System.Xml.Linq/Test/System.Xml.XPath/ExtensionsTest2.cs

@@ -416,7 +416,6 @@ namespace MonoTests.System.Xml
 			Assert.IsTrue (i.MoveNext (), "#2");
 		}
 
-#if NET_2_0
 		[Test]
 		public void ValueAsBoolean ()
 		{
@@ -687,6 +686,5 @@ namespace MonoTests.System.Xml
 				return;
 			Assert.Fail ("no selection");
 		}
-#endif
 	}
 }