Permalink
Browse files

2005-12-14 Atsushi Enomoto <atsushi@ximian.com>

	* XmlDocumentTests.cs : (CreateNodeNodeTypeName) the previous fix was 
	  wrong; ArgumentException is the expected exception (it anyways won't
	  work under MS.NET 2.0).
	* XmlNodeTests.cs : added labels to assertions. another NotDotNet case.
	* XmlAttributeTests.cs : ditto.


svn path=/trunk/mcs/; revision=54351
  • Loading branch information...
atsushieno committed Dec 14, 2005
1 parent 0940b75 commit 36b7985e54a28abafa065eecad445ca0b40d002c
@@ -1,3 +1,11 @@
+2005-12-14 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlDocumentTests.cs : (CreateNodeNodeTypeName) the previous fix was
+ wrong; ArgumentException is the expected exception (it anyways won't
+ work under MS.NET 2.0).
+ * XmlNodeTests.cs : added labels to assertions. another NotDotNet case.
+ * XmlAttributeTests.cs : ditto.
+
2005-12-14 Atsushi Enomoto <atsushi@ximian.com>
* XmlDocumentTests.cs, XmlAttributeCollectionTests.cs
@@ -151,6 +151,9 @@ public void Value ()
}
[Test]
+#if NET_2_0
+ [Category ("NotDotNet")] // enbug in 2.0
+#endif
public void SetInnerTextAndXml ()
{
string original = doc.OuterXml;
@@ -164,9 +167,10 @@ public void SetInnerTextAndXml ()
AssertEquals ("setInnerXml.InnerXml", "'a&amp;b'", attr.InnerXml);
AssertEquals ("setInnerXml.Value", "'a&b'", attr.Value);
attr.InnerXml = "\"a&amp;b\"";
- AssertEquals ("\"a&amp;b\"", attr.InnerXml);
+ AssertEquals ("Double_Quote", "\"a&amp;b\"", attr.InnerXml);
attr.InnerXml = "\"a&amp;b'";
- AssertEquals ("\"a&amp;b'", attr.InnerXml);
+ AssertEquals ("DoubleQuoteStart_SingleQuoteEnd",
+ "\"a&amp;b'", attr.InnerXml);
attr.Value = "";
XmlNodeChangedEventHandler evInserted = new XmlNodeChangedEventHandler (EventNodeInserted);
@@ -213,11 +213,7 @@ public void CreateNodeNodeTypeName ()
try {
node = document.CreateNode ("foo", null, null);
Fail ("Expected an ArgumentException to be thrown.");
-#if NET_2_0
- } catch (ArgumentNullException) {}
-#else
- } catch (ArgumentException) {} // makes less sense
-#endif
+ } catch (ArgumentException) {}
// .NET 2.0 fails here.
node = document.CreateNode("attribute", "foo", null);
@@ -126,18 +126,28 @@ public void GetNamespaceOfPrefix ()
document.LoadXml ("<root xmlns='urn:default' attr='value' "
+ "xml:lang='en' xmlns:foo='urn:foo' foo:att='fooatt'>text node</root>");
XmlNode n = document.DocumentElement;
- AssertEquals ("urn:default", n.GetNamespaceOfPrefix (String.Empty));
- AssertEquals ("urn:foo", n.GetNamespaceOfPrefix ("foo"));
- AssertEquals (String.Empty, n.GetNamespaceOfPrefix ("bar"));
- AssertEquals (String.Empty, n.GetNamespaceOfPrefix ("xml"));
- AssertEquals (String.Empty, n.GetNamespaceOfPrefix ("xmlns"));
+ AssertEquals ("#1", "urn:default", n.GetNamespaceOfPrefix (String.Empty));
+ AssertEquals ("#2", "urn:foo", n.GetNamespaceOfPrefix ("foo"));
+ AssertEquals ("#3", String.Empty, n.GetNamespaceOfPrefix ("bar"));
+#if NET_2_0
+ AssertEquals ("#4", "http://www.w3.org/XML/1998/namespace", n.GetNamespaceOfPrefix ("xml"));
+ AssertEquals ("#5", "http://www.w3.org/2000/xmlns/", n.GetNamespaceOfPrefix ("xmlns"));
+#else
+ AssertEquals ("#4", String.Empty, n.GetNamespaceOfPrefix ("xml"));
+ AssertEquals ("#5", String.Empty, n.GetNamespaceOfPrefix ("xmlns"));
+#endif
n = document.DocumentElement.FirstChild;
- AssertEquals ("urn:default", n.GetNamespaceOfPrefix (String.Empty));
- AssertEquals ("urn:foo", n.GetNamespaceOfPrefix ("foo"));
- AssertEquals (String.Empty, n.GetNamespaceOfPrefix ("bar"));
- AssertEquals (String.Empty, n.GetNamespaceOfPrefix ("xml"));
- AssertEquals (String.Empty, n.GetNamespaceOfPrefix ("xmlns"));
+ AssertEquals ("#6", "urn:default", n.GetNamespaceOfPrefix (String.Empty));
+ AssertEquals ("#7", "urn:foo", n.GetNamespaceOfPrefix ("foo"));
+ AssertEquals ("#8", String.Empty, n.GetNamespaceOfPrefix ("bar"));
+#if NET_2_0
+ AssertEquals ("#9", "http://www.w3.org/XML/1998/namespace", n.GetNamespaceOfPrefix ("xml"));
+ AssertEquals ("#10", "http://www.w3.org/2000/xmlns/", n.GetNamespaceOfPrefix ("xmlns"));
+#else
+ AssertEquals ("#9", String.Empty, n.GetNamespaceOfPrefix ("xml"));
+ AssertEquals ("#10", String.Empty, n.GetNamespaceOfPrefix ("xmlns"));
+#endif
}
[Test]

0 comments on commit 36b7985

Please sign in to comment.