Browse Source

2009-06-26 Atsushi Enomoto <[email protected]>

	* SelectNodesTests.cs
	  XPathNavigatorCommonTests.cs
	  XPathAtomicValueTests.cs
	  XPathNavigatorTests.cs
	  XPathNavigatorEvaluateTests.cs : convert to newer nunit style.


svn path=/trunk/mcs/; revision=136928
Atsushi Eno 16 years ago
parent
commit
bea9bf9dc0

+ 8 - 0
mcs/class/System.XML/Test/System.Xml.XPath/ChangeLog

@@ -1,3 +1,11 @@
+2009-06-26  Atsushi Enomoto <[email protected]>
+
+	* SelectNodesTests.cs
+	  XPathNavigatorCommonTests.cs
+	  XPathAtomicValueTests.cs
+	  XPathNavigatorTests.cs
+	  XPathNavigatorEvaluateTests.cs : convert to newer nunit style.
+
 2009-05-15  Atsushi Enomoto <[email protected]>
 
 	* XPathNavigatorCommonTests.cs : test that LookupNamespace() in

+ 65 - 65
mcs/class/System.XML/Test/System.Xml.XPath/SelectNodesTests.cs

@@ -16,7 +16,7 @@ using NUnit.Framework;
 namespace MonoTests.System.Xml.XPath
 {
 	[TestFixture]
-	public class SelectNodesTests : Assertion
+	public class SelectNodesTests
 	{
 
 		[Test]
@@ -25,8 +25,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XmlNodeList nodes = document.SelectNodes ("/");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document, nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document, nodes [0], "#2");
 		}
 
 		[Test]
@@ -35,8 +35,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XmlNodeList nodes = document.SelectNodes ("/foo");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement, nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement, nodes [0], "#2");
 		}
 
 		[Test]
@@ -45,7 +45,7 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XmlNodeList nodes = document.SelectNodes ("/bar");
-			AssertEquals (0, nodes.Count);
+			Assert.AreEqual (0, nodes.Count, "#1");
 		}
 
 		[Test]
@@ -54,9 +54,9 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /><baz /></foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/*");
-			AssertEquals (2, nodes.Count);
-			AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
-			AssertSame (document.DocumentElement.ChildNodes [1], nodes [1]);
+			Assert.AreEqual (2, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.ChildNodes [0], nodes [0], "#2");
+			Assert.AreSame (document.DocumentElement.ChildNodes [1], nodes [1], "#3");
 		}
 
 		[Test]
@@ -65,8 +65,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /><baz /></foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/bar");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.ChildNodes [0], nodes [0], "#2");
 		}
 
 		[Test]
@@ -75,8 +75,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /><baz /></foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/baz");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement.ChildNodes [1], nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.ChildNodes [1], nodes [0]);
 		}
 
 		[Test]
@@ -85,8 +85,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo>bar</foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/text()");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.ChildNodes [0], nodes [0]);
 		}
 
 		[Test]
@@ -95,9 +95,9 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo>bar<baz />quux</foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/text()");
-			AssertEquals (2, nodes.Count);
-			AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
-			AssertSame (document.DocumentElement.ChildNodes [2], nodes [1]);
+			Assert.AreEqual (2, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.ChildNodes [0], nodes [0], "#2");
+			Assert.AreSame (document.DocumentElement.ChildNodes [2], nodes [1], "#3");
 		}
 
 		[Test]
@@ -106,8 +106,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /></foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/bar/..");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement, nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement, nodes [0], "#2");
 		}
 
 		[Test]
@@ -116,8 +116,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /></foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/bar/parent::node()");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement, nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement, nodes [0], "#2");
 		}
 
 		[Test]
@@ -126,8 +126,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo bar='baz' />");
 			XmlNodeList nodes = document.SelectNodes ("/foo/@bar");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement.Attributes ["bar"], nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.Attributes ["bar"], nodes [0], "#2");
 		}
 
 		[Test]
@@ -136,8 +136,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo bar='baz' />");
 			XmlNodeList nodes = document.SelectNodes ("/foo/attribute::bar");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement.Attributes ["bar"], nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.Attributes ["bar"], nodes [0], "#2");
 		}
 
 		[Test]
@@ -146,10 +146,10 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo bar='baz' quux='quuux' />");
 			XmlNodeList nodes = document.SelectNodes ("/foo/@*");
-			AssertEquals (2, nodes.Count);
+			Assert.AreEqual (2, nodes.Count, "#1");
 			// are the attributes guanteed to be ordered in the node list?
-			AssertSame (document.DocumentElement.Attributes ["bar"], nodes [0]);
-			AssertSame (document.DocumentElement.Attributes ["quux"], nodes [1]);
+			Assert.AreSame (document.DocumentElement.Attributes ["bar"], nodes [0], "#2");
+			Assert.AreSame (document.DocumentElement.Attributes ["quux"], nodes [1], "#3");
 		}
 
 		[Test]
@@ -158,8 +158,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo bar='baz' />");
 			XmlNodeList nodes = document.SelectNodes ("/foo/@bar/..");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement, nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement, nodes [0], "#2");
 		}
 		
 		[Test]
@@ -168,9 +168,9 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /><baz /></foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/bar|/foo/baz");
-			AssertEquals (2, nodes.Count);
-			AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
-			AssertSame (document.DocumentElement.ChildNodes [1], nodes [1]);
+			Assert.AreEqual (2, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.ChildNodes [0], nodes [0], "#2");
+			Assert.AreSame (document.DocumentElement.ChildNodes [1], nodes [1], "#3");
 		}
 		
 		[Test]
@@ -179,10 +179,10 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar />baz<quux /></foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/node()");
-			AssertEquals (3, nodes.Count);
-			AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
-			AssertSame (document.DocumentElement.ChildNodes [1], nodes [1]);
-			AssertSame (document.DocumentElement.ChildNodes [2], nodes [2]);
+			Assert.AreEqual (3, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.ChildNodes [0], nodes [0], "#2");
+			Assert.AreSame (document.DocumentElement.ChildNodes [1], nodes [1], "#3");
+			Assert.AreSame (document.DocumentElement.ChildNodes [2], nodes [2], "#4");
 		}
 
 		[Test]
@@ -191,8 +191,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar>1</bar><bar>2</bar></foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/bar[1]");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.ChildNodes [0], nodes [0], "#2");
 		}
 
 		[Test]
@@ -201,9 +201,9 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /><baz /><quux /></foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/bar/following-sibling::*");
-			AssertEquals (2, nodes.Count);
-			AssertSame (document.DocumentElement.ChildNodes [1], nodes [0]);
-			AssertSame (document.DocumentElement.ChildNodes [2], nodes [1]);
+			Assert.AreEqual (2, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.ChildNodes [1], nodes [0], "#2");
+			Assert.AreSame (document.DocumentElement.ChildNodes [2], nodes [1], "#3");
 		}
 
 		[Test]
@@ -212,8 +212,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /><baz /><quux /></foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/bar/following-sibling::baz");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement.ChildNodes [1], nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.ChildNodes [1], nodes [0], "#2");
 		}
 
 		[Test]
@@ -222,8 +222,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /><baz /><quux /></foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/bar/following-sibling::quux");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement.ChildNodes [2], nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement.ChildNodes [2], nodes [0], "#2");
 		}
 
 		[Test]
@@ -232,8 +232,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XmlNodeList nodes = document.SelectNodes ("(/foo) | (/foo)");
-			AssertEquals (1, nodes.Count);	// bug #27548
-			AssertSame (document.DocumentElement, nodes [0]);
+			Assert.AreEqual (1, nodes.Count);	// bug #27548, "#1");
+			Assert.AreSame (document.DocumentElement, nodes [0], "#1");
 		}
 
 		[Test]
@@ -242,8 +242,8 @@ namespace MonoTests.System.Xml.XPath
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo1 />");
 			XmlNodeList nodes = document.SelectNodes ("/foo1");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement, nodes [0]);
+			Assert.AreEqual (1, nodes.Count, "#1");
+			Assert.AreSame (document.DocumentElement, nodes [0], "#2");
 		}
 
 		[Test]
@@ -254,7 +254,7 @@ namespace MonoTests.System.Xml.XPath
 			XmlNamespaceManager nsmgr = new XmlNamespaceManager(document.NameTable);
 			nsmgr.AddNamespace("foons", "urn:foo1:foo2");
 			XmlNodeList nodes = document.SelectNodes ("/foons:root", nsmgr);
-			AssertEquals (1, nodes.Count);
+			Assert.AreEqual (1, nodes.Count, "#1");
 		}
 
 		[Test]
@@ -265,17 +265,17 @@ namespace MonoTests.System.Xml.XPath
 			doc.LoadXml ("<root xmlns='urn:root' xmlns:hoge='urn:hoge'><foo xmlns='urn:foo'><bar xmlns=''><baz/></bar></foo></root>");
 			XmlNode n = doc.FirstChild.FirstChild.FirstChild.FirstChild; //baz
 			XmlNodeList nl = n.SelectNodes ("namespace::*");
-			AssertEquals ("hoge", nl [0].LocalName);
-			AssertEquals ("xml", nl [1].LocalName);
-			AssertEquals (2, nl.Count);
+			Assert.AreEqual ("hoge", nl [0].LocalName, "#1");
+			Assert.AreEqual ("xml", nl [1].LocalName, "#2");
+			Assert.AreEqual (2, nl.Count, "#3");
 
 			n = doc.FirstChild.FirstChild; // foo
 			nl = n.SelectNodes ("namespace::*");
 			Console.WriteLine ("at foo::");
-			AssertEquals ("xmlns", nl [0].LocalName);
-			AssertEquals ("hoge", nl [1].LocalName);
-			AssertEquals ("xml", nl [2].LocalName);
-			AssertEquals (3, nl.Count);
+			Assert.AreEqual ("xmlns", nl [0].LocalName, "#1");
+			Assert.AreEqual ("hoge", nl [1].LocalName, "#2");
+			Assert.AreEqual ("xml", nl [2].LocalName, "#3");
+			Assert.AreEqual (3, nl.Count, "#4");
 		}
 
 		[Test]
@@ -289,9 +289,9 @@ namespace MonoTests.System.Xml.XPath
 
 			XmlNode bax = baxs [0];
 			XmlNodeList ans = bax.SelectNodes ("ancestor::*");
-			AssertEquals (2, ans.Count);
-			AssertEquals ("bar", ans [0].Name);
-			AssertEquals ("baz", ans [1].Name);
+			Assert.AreEqual (2, ans.Count, "#1");
+			Assert.AreEqual ("bar", ans [0].Name, "#2");
+			Assert.AreEqual ("baz", ans [1].Name, "#3");
 		}
 
 		[Test] // bug #458245
@@ -313,7 +313,7 @@ namespace MonoTests.System.Xml.XPath
 			ns.AddNamespace ("_", "urn:foo");
 			string xpath = "//_:div//_:div//_:div";
 			var nodes = doc.SelectNodes (xpath, ns);
-			AssertEquals (4, nodes.Count);
+			Assert.AreEqual (4, nodes.Count, "#1");
 		}
 
 		[Test]
@@ -340,9 +340,9 @@ namespace MonoTests.System.Xml.XPath
 			ns.AddNamespace ("_", "http://www.w3.org/1999/xhtml");
 
 			XmlNode n = doc.SelectSingleNode ("//_:html", ns);
-			Assert ("#1", n != null);
+			Assert.IsTrue (n != null, "#1");
 			XmlNodeList nodes = n.SelectNodes (".//_:div//_:div", ns);
-			AssertEquals ("#2", 5, nodes.Count);
+			Assert.AreEqual (5, nodes.Count, "#2");
 		}
 	}
 }

+ 29 - 29
mcs/class/System.XML/Test/System.Xml.XPath/XPathAtomicValueTests.cs

@@ -40,7 +40,7 @@ using NUnit.Framework;
 namespace MonoTests.System.Xml
 {
 	[TestFixture]
-	public class XPathAtomicValueTests : Assertion
+	public class XPathAtomicValueTests
 	{
 		internal const string XdtNamespace = "http://www.w3.org/2003/11/xpath-datatypes";
 
@@ -158,18 +158,18 @@ namespace MonoTests.System.Xml
 			object singleValue,
 			int listCount)
 		{
-			AssertEquals ("IsNode", isNode, av.IsNode);
-			AssertEquals ("ValueType", valueType, av.ValueType);
-			AssertEquals ("XmlType", xmlType, av.XmlType);
-			AssertEquals ("TypedValue", typedValue, av.TypedValue);
-			AssertEquals ("typedValue.GetType()", typedValueType, typedValue.GetType ());
+			Assert.AreEqual (isNode, av.IsNode, "IsNode");
+			Assert.AreEqual (valueType, av.ValueType, "ValueType");
+			Assert.AreEqual (xmlType, av.XmlType, "XmlType");
+			Assert.AreEqual (typedValue, av.TypedValue, "TypedValue");
+			Assert.AreEqual (typedValueType, typedValue.GetType (), "typedValue.GetType()");
 
 			if (value != null)
-				AssertEquals ("Value", value, av.Value);
+				Assert.AreEqual (value, av.Value, "Value");
 			else {
 				try {
 					value = av.Value;
-					Fail ("not supported conversion to String.");
+					Assert.Fail ("not supported conversion to String.");
 				} catch (InvalidCastException) {
 				}
 			}
@@ -177,83 +177,83 @@ namespace MonoTests.System.Xml
 			// FIXME: Failure cases could not be tested;
 			// any kind of Exceptions are thrown as yet.
 			if (boolValue != null)
-				AssertEquals ("ValueAsBoolean", boolValue, av.ValueAsBoolean);
+				Assert.AreEqual (boolValue, av.ValueAsBoolean, "ValueAsBoolean");
 			/*
 			else {
 				try {
 					boolValue = av.ValueAsBoolean;
-					Fail ("not supported conversion to Boolean.");
+					Assert.Fail ("not supported conversion to Boolean.");
 				} catch (InvalidCastException) {
 				}
 			}
 			*/
 			if (dateValue != null)
-				AssertEquals ("ValueAsDateTime", dateValue, av.ValueAsDateTime);
+				Assert.AreEqual (dateValue, av.ValueAsDateTime, "ValueAsDateTime");
 			/*
 			else {
 				try {
 					dateValue = av.ValueAsDateTime;
-					Fail ("not supported conversion to DateTime.");
+					Assert.Fail ("not supported conversion to DateTime.");
 				} catch (InvalidCastException) {
 				}
 			}
 			*/
 			if (decimalValue != null)
-				AssertEquals ("ValueAsDecimal", decimalValue, av.ValueAsDecimal);
+				Assert.AreEqual (decimalValue, av.ValueAsDecimal, "ValueAsDecimal");
 			/*
 			else {
 				try {
 					decimalValue = av.ValueAsDecimal;
-					Fail ("not supported conversion to Decimal.");
+					Assert.Fail ("not supported conversion to Decimal.");
 				} catch (InvalidCastException) {
 				}
 			}
 			*/
 			if (doubleValue != null)
-				AssertEquals ("ValueAsDouble", doubleValue, av.ValueAsDouble);
+				Assert.AreEqual (doubleValue, av.ValueAsDouble, "ValueAsDouble");
 			/*
 			else {
 				try {
 					doubleValue = av.ValueAsDouble;
-					Fail ("not supported conversion to Double.");
+					Assert.Fail ("not supported conversion to Double.");
 				} catch (InvalidCastException) {
 				}
 			}
 			*/
 			if (int32Value != null)
-				AssertEquals ("ValueAsInt32", int32Value, av.ValueAsInt32);
+				Assert.AreEqual (int32Value, av.ValueAsInt32, "ValueAsInt32");
 			/*
 			else {
 				try {
 					int32Value = av.ValueAsInt32;
-					Fail ("not supported conversion to Int32.");
+					Assert.Fail ("not supported conversion to Int32.");
 				} catch (InvalidCastException) {
 				}
 			}
 			*/
 			if (int64Value != null)
-				AssertEquals ("ValueAsInt64", int64Value, av.ValueAsInt64);
+				Assert.AreEqual (int64Value, av.ValueAsInt64, "ValueAsInt64");
 			/*
 			else {
 				try {
 					int64Value = av.ValueAsInt64;
-					Fail ("not supported conversion to Int64.");
+					Assert.Fail ("not supported conversion to Int64.");
 				} catch (InvalidCastException) {
 				}
 			}
 			*/
 			if (singleValue != null)
-				AssertEquals ("ValueAsSingle", singleValue, av.ValueAsSingle);
+				Assert.AreEqual (singleValue, av.ValueAsSingle, "ValueAsSingle");
 			/*
 			else {
 				try {
 					singleValue = av.ValueAsSingle;
-					Fail ("not supported conversion to Single.");
+					Assert.Fail ("not supported conversion to Single.");
 				} catch (InvalidCastException) {
 				}
 			}
 			*/
-			AssertEquals ("ValueAsList.Count", listCount, av.ValueAsList.Count);
+			Assert.AreEqual (listCount, av.ValueAsList.Count, "ValueAsList.Count");
 		}
 
 		[Test]
@@ -471,7 +471,7 @@ namespace MonoTests.System.Xml
 			av = new XPathAtomicValue (new bool [] {true, false}, xstype);
 			try {
 				object o = av.ValueAsBoolean;
-				Fail ("ArrayList must contain just one item to be castable to bool");
+				Assert.Fail ("ArrayList must contain just one item to be castable to bool");
 			} catch (InvalidCastException) {
 			}
 
@@ -479,7 +479,7 @@ namespace MonoTests.System.Xml
 			av = new XPathAtomicValue (new ArrayList (), xstype);
 			try {
 				object o = av.ValueAsBoolean;
-				Fail ("ArrayList must contain just one item to be castable to bool");
+				Assert.Fail ("ArrayList must contain just one item to be castable to bool");
 			} catch (InvalidCastException) {
 			}
 
@@ -487,7 +487,7 @@ namespace MonoTests.System.Xml
 			av = new XPathAtomicValue ("True", xstype);
 			try {
 				object o = av.ValueAsBoolean;
-				Fail ("\"True\" is not a boolean representation (\"true\" is).");
+				Assert.Fail ("\"True\" is not a boolean representation (\"true\" is).");
 			} catch (InvalidCastException) {
 			}
 
@@ -495,7 +495,7 @@ namespace MonoTests.System.Xml
 			av = new XPathAtomicValue (DateTime.Now, xstype);
 			try {
 				object o = av.ValueAsBoolean;
-				Fail ("DateTime should not be castable to bool.");
+				Assert.Fail ("DateTime should not be castable to bool.");
 			} catch (InvalidCastException) {
 			}
 
@@ -506,7 +506,7 @@ namespace MonoTests.System.Xml
 			av = new XPathAtomicValue (node, xstype);
 			try {
 				object o = av.ValueAsBoolean;
-				Fail ("XmlText cannot be castable to bool.");
+				Assert.Fail ("XmlText cannot be castable to bool.");
 			} catch (InvalidCastException) {
 			}
 
@@ -516,7 +516,7 @@ namespace MonoTests.System.Xml
 				xstype);
 			try {
 				object o = av.ValueAsBoolean;
-				Fail ("XmlText cannot be castable to bool.");
+				Assert.Fail ("XmlText cannot be castable to bool.");
 			} catch (InvalidCastException) {
 			}
 		}

+ 84 - 86
mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorCommonTests.cs

@@ -16,7 +16,7 @@ using NUnit.Framework;
 namespace MonoTests.System.Xml
 {
 	[TestFixture]
-	public class XPathNavigatorCommonTests : Assertion
+	public class XPathNavigatorCommonTests
 	{
 		XmlDocument document;
 		XPathNavigator nav;
@@ -51,15 +51,15 @@ namespace MonoTests.System.Xml
 		private void AssertNavigator (string label, XPathNavigator nav, XPathNodeType type, string prefix, string localName, string ns, string name, string value, bool hasAttributes, bool hasChildren, bool isEmptyElement)
 		{
 			label += nav.GetType ();
-			AssertEquals (label + "NodeType", type, nav.NodeType);
-			AssertEquals (label + "Prefix", prefix, nav.Prefix);
-			AssertEquals (label + "LocalName", localName, nav.LocalName);
-			AssertEquals (label + "Namespace", ns, nav.NamespaceURI);
-			AssertEquals (label + "Name", name, nav.Name);
-			AssertEquals (label + "Value", value, nav.Value);
-			AssertEquals (label + "HasAttributes", hasAttributes, nav.HasAttributes);
-			AssertEquals (label + "HasChildren", hasChildren, nav.HasChildren);
-			AssertEquals (label + "IsEmptyElement", isEmptyElement, nav.IsEmptyElement);
+			Assert.AreEqual (type, nav.NodeType, label + "NodeType");
+			Assert.AreEqual (prefix, nav.Prefix, label + "Prefix");
+			Assert.AreEqual (localName, nav.LocalName, label + "LocalName");
+			Assert.AreEqual (ns, nav.NamespaceURI, label + "Namespace");
+			Assert.AreEqual (name, nav.Name, label + "Name");
+			Assert.AreEqual (value, nav.Value, label + "Value");
+			Assert.AreEqual (hasAttributes, nav.HasAttributes, label + "HasAttributes");
+			Assert.AreEqual (hasChildren, nav.HasChildren, label + "HasChildren");
+			Assert.AreEqual (isEmptyElement, nav.IsEmptyElement, label + "IsEmptyElement");
 		}
 
 		[Test]
@@ -92,9 +92,9 @@ namespace MonoTests.System.Xml
 
 		public void DocumentWithProcessingInstruction (XPathNavigator nav)
 		{
-			Assert (nav.MoveToFirstChild ());
+			Assert.IsTrue (nav.MoveToFirstChild ());
 			AssertNavigator ("#1", nav, XPathNodeType.ProcessingInstruction, "", "xml-stylesheet", "", "xml-stylesheet", "href='foo.xsl' type='text/xsl' ", false, false, false);
-			Assert (!nav.MoveToFirstChild ());
+			Assert.IsTrue (!nav.MoveToFirstChild ());
 		}
 
 		[Test]
@@ -111,14 +111,14 @@ namespace MonoTests.System.Xml
 		private void XmlRootElementOnly (XPathNavigator nav)
 		{
 			AssertNavigator ("#1", nav, XPathNodeType.Root, "", "", "", "", "", false, true, false);
-			Assert (nav.MoveToFirstChild ());
+			Assert.IsTrue (nav.MoveToFirstChild ());
 			AssertNavigator ("#2", nav, XPathNodeType.Element, "", "foo", "", "foo", "", false, false, true);
-			Assert (!nav.MoveToFirstChild ());
-			Assert (!nav.MoveToNext ());
-			Assert (!nav.MoveToPrevious ());
+			Assert.IsTrue (!nav.MoveToFirstChild ());
+			Assert.IsTrue (!nav.MoveToNext ());
+			Assert.IsTrue (!nav.MoveToPrevious ());
 			nav.MoveToRoot ();
 			AssertNavigator ("#3", nav, XPathNodeType.Root, "", "", "", "", "", false, true, false);
-			Assert (!nav.MoveToNext ());
+			Assert.IsTrue (!nav.MoveToNext ());
 		}
 
 		[Test]
@@ -135,24 +135,24 @@ namespace MonoTests.System.Xml
 		private void XmlSimpleTextContent (XPathNavigator nav)
 		{
 			AssertNavigator ("#1", nav, XPathNodeType.Root, "", "", "", "", "Test.", false, true, false);
-			Assert (nav.MoveToFirstChild ());
+			Assert.IsTrue (nav.MoveToFirstChild ());
 			AssertNavigator ("#2", nav, XPathNodeType.Element, "", "foo", "", "foo", "Test.", false, true, false);
-			Assert (!nav.MoveToNext ());
-			Assert (!nav.MoveToPrevious ());
-			Assert (nav.MoveToFirstChild ());
+			Assert.IsTrue (!nav.MoveToNext ());
+			Assert.IsTrue (!nav.MoveToPrevious ());
+			Assert.IsTrue (nav.MoveToFirstChild ());
 			AssertNavigator ("#3", nav, XPathNodeType.Text, "", "", "", "", "Test.", false, false, false);
 
-			Assert (nav.MoveToParent ());
+			Assert.IsTrue (nav.MoveToParent ());
 			AssertNavigator ("#4", nav, XPathNodeType.Element, "", "foo", "", "foo", "Test.", false, true, false);
 
-			Assert (nav.MoveToParent ());
+			Assert.IsTrue (nav.MoveToParent ());
 			AssertNavigator ("#5", nav, XPathNodeType.Root, "", "", "", "", "Test.", false, true, false);
 
 			nav.MoveToFirstChild ();
 			nav.MoveToFirstChild ();
 			nav.MoveToRoot ();
 			AssertNavigator ("#6", nav, XPathNodeType.Root, "", "", "", "", "Test.", false, true, false);
-			Assert (!nav.MoveToNext ());
+			Assert.IsTrue (!nav.MoveToNext ());
 		}
 
 		[Test]
@@ -169,20 +169,20 @@ namespace MonoTests.System.Xml
 		private void XmlSimpleElementContent (XPathNavigator nav)
 		{
 			AssertNavigator ("#1", nav, XPathNodeType.Root, "", "", "", "", "", false, true, false);
-			Assert (nav.MoveToFirstChild ());
+			Assert.IsTrue (nav.MoveToFirstChild ());
 			AssertNavigator ("#2", nav, XPathNodeType.Element, "", "foo", "", "foo", "", false, true, false);
-			Assert (!nav.MoveToNext ());
-			Assert (!nav.MoveToPrevious ());
+			Assert.IsTrue (!nav.MoveToNext ());
+			Assert.IsTrue (!nav.MoveToPrevious ());
 
-			Assert (nav.MoveToFirstChild ());
+			Assert.IsTrue (nav.MoveToFirstChild ());
 			AssertNavigator ("#3", nav, XPathNodeType.Element, "", "bar", "", "bar", "", false, false, true);
 
-			Assert (nav.MoveToParent ());
+			Assert.IsTrue (nav.MoveToParent ());
 			AssertNavigator ("#4", nav, XPathNodeType.Element, "", "foo", "", "foo", "", false, true, false);
 
 			nav.MoveToRoot ();
 			AssertNavigator ("#5", nav, XPathNodeType.Root, "", "", "", "", "", false, true, false);
-			Assert (!nav.MoveToNext ());
+			Assert.IsTrue (!nav.MoveToNext ());
 		}
 
 		[Test]
@@ -200,25 +200,25 @@ namespace MonoTests.System.Xml
 		{
 			AssertNavigator ("#1", nav, XPathNodeType.Root, "", "", "", "", "", false, true, false);
 
-			Assert (nav.MoveToFirstChild ());
+			Assert.IsTrue (nav.MoveToFirstChild ());
 			AssertNavigator ("#2", nav, XPathNodeType.Element, "", "foo", "", "foo", "", false, true, false);
-			Assert (!nav.MoveToNext ());
-			Assert (!nav.MoveToPrevious ());
+			Assert.IsTrue (!nav.MoveToNext ());
+			Assert.IsTrue (!nav.MoveToPrevious ());
 
-			Assert (nav.MoveToFirstChild ());
+			Assert.IsTrue (nav.MoveToFirstChild ());
 			AssertNavigator ("#3", nav, XPathNodeType.Element, "", "bar", "", "bar", "", false, false, true);
-			Assert (!nav.MoveToFirstChild ());
+			Assert.IsTrue (!nav.MoveToFirstChild ());
 
-			Assert (nav.MoveToNext ());
+			Assert.IsTrue (nav.MoveToNext ());
 			AssertNavigator ("#4", nav, XPathNodeType.Element, "", "baz", "", "baz", "", false, false, true);
-			Assert (!nav.MoveToFirstChild ());
+			Assert.IsTrue (!nav.MoveToFirstChild ());
 
-			Assert (nav.MoveToPrevious ());
+			Assert.IsTrue (nav.MoveToPrevious ());
 			AssertNavigator ("#5", nav, XPathNodeType.Element, "", "bar", "", "bar", "", false, false, true);
 
 			nav.MoveToRoot ();
 			AssertNavigator ("#6", nav, XPathNodeType.Root, "", "", "", "", "", false, true, false);
-			Assert (!nav.MoveToNext ());
+			Assert.IsTrue (!nav.MoveToNext ());
 		}
 
 		[Test]
@@ -236,25 +236,25 @@ namespace MonoTests.System.Xml
 		{
 			nav.MoveToFirstChild ();
 			AssertNavigator ("#1", nav, XPathNodeType.Element, "", "img", "", "img", "", true, false, true);
-			Assert (!nav.MoveToNext ());
-			Assert (!nav.MoveToPrevious ());
+			Assert.IsTrue (!nav.MoveToNext ());
+			Assert.IsTrue (!nav.MoveToPrevious ());
 
-			Assert (nav.MoveToFirstAttribute ());
+			Assert.IsTrue (nav.MoveToFirstAttribute ());
 			AssertNavigator ("#2", nav, XPathNodeType.Attribute, "", "src", "", "src", "foo.png", false, false, false);
-			Assert (!nav.MoveToFirstAttribute ());	// On attributes, it fails.
+			Assert.IsTrue (!nav.MoveToFirstAttribute ());	// On attributes, it fails.
 
-			Assert (nav.MoveToNextAttribute ());
+			Assert.IsTrue (nav.MoveToNextAttribute ());
 			AssertNavigator ("#3", nav, XPathNodeType.Attribute, "", "alt", "", "alt", "image Fooooooo!", false, false, false);
-			Assert (!nav.MoveToNextAttribute ());
+			Assert.IsTrue (!nav.MoveToNextAttribute ());
 
-			Assert (nav.MoveToParent ());
+			Assert.IsTrue (nav.MoveToParent ());
 			AssertNavigator ("#4", nav, XPathNodeType.Element, "", "img", "", "img", "", true, false, true);
 
-			Assert (nav.MoveToAttribute ("alt", ""));
+			Assert.IsTrue (nav.MoveToAttribute ("alt", ""));
 			AssertNavigator ("#5", nav, XPathNodeType.Attribute, "", "alt", "", "alt", "image Fooooooo!", false, false, false);
-			Assert (!nav.MoveToAttribute ("src", ""));	// On attributes, it fails.
-			Assert (nav.MoveToParent ());
-			Assert (nav.MoveToAttribute ("src", ""));
+			Assert.IsTrue (!nav.MoveToAttribute ("src", ""));	// On attributes, it fails.
+			Assert.IsTrue (nav.MoveToParent ());
+			Assert.IsTrue (nav.MoveToAttribute ("src", ""));
 			AssertNavigator ("#6", nav, XPathNodeType.Attribute, "", "src", "", "src", "foo.png", false, false, false);
 
 			nav.MoveToRoot ();
@@ -283,20 +283,20 @@ namespace MonoTests.System.Xml
 			nav.MoveToFirstChild ();
 			AssertNavigator ("#1", nav, XPathNodeType.Element,
 				"", "html", xhtml, "html", "test.", false, true, false);
-			Assert (nav.MoveToFirstNamespace (XPathNamespaceScope.Local));
+			Assert.IsTrue (nav.MoveToFirstNamespace (XPathNamespaceScope.Local));
 			AssertNavigator ("#2", nav, XPathNodeType.Namespace,
 				"", "", "", "", xhtml, false, false, false);
 
 			// Test difference between Local, ExcludeXml and All.
-			Assert (!nav.MoveToNextNamespace (XPathNamespaceScope.Local));
-			Assert (!nav.MoveToNextNamespace (XPathNamespaceScope.ExcludeXml));
+			Assert.IsTrue (!nav.MoveToNextNamespace (XPathNamespaceScope.Local));
+			Assert.IsTrue (!nav.MoveToNextNamespace (XPathNamespaceScope.ExcludeXml));
 			// LAMESPEC: MS.NET 1.0 XmlDocument seems to have some bugs around here.
 			// see http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q316808
 #if true
-			Assert (nav.MoveToNextNamespace (XPathNamespaceScope.All));
+			Assert.IsTrue (nav.MoveToNextNamespace (XPathNamespaceScope.All));
 			AssertNavigator ("#3", nav, XPathNodeType.Namespace,
 				"", "xml", "", "xml", xmlNS, false, false, false);
-			Assert (!nav.MoveToNextNamespace (XPathNamespaceScope.All));
+			Assert.IsTrue (!nav.MoveToNextNamespace (XPathNamespaceScope.All));
 #endif
 			// Test to check if MoveToRoot() resets Namespace node status.
 			nav.MoveToRoot ();
@@ -304,29 +304,27 @@ namespace MonoTests.System.Xml
 			nav.MoveToFirstChild ();
 
 			// Test without XPathNamespaceScope argument.
-			Assert (nav.MoveToFirstNamespace ());
-			Assert (nav.MoveToNextNamespace ());
+			Assert.IsTrue (nav.MoveToFirstNamespace ());
+			Assert.IsTrue (nav.MoveToNextNamespace ());
 			AssertNavigator ("#5", nav, XPathNodeType.Namespace,
 				"", "xml", "", "xml", xmlNS, false, false, false);
 
 			// Test MoveToParent()
-			Assert (nav.MoveToParent ());
+			Assert.IsTrue (nav.MoveToParent ());
 			AssertNavigator ("#6", nav, XPathNodeType.Element,
 				"", "html", xhtml, "html", "test.", false, true, false);
 
 			nav.MoveToFirstChild ();	// body
 			// Test difference between Local and ExcludeXml
-			Assert ("Local should fail",
-				!nav.MoveToFirstNamespace (XPathNamespaceScope.Local));
-			Assert ("ExcludeXml should succeed",
-				nav.MoveToFirstNamespace (XPathNamespaceScope.ExcludeXml));
+			Assert.IsTrue (!nav.MoveToFirstNamespace (XPathNamespaceScope.Local), "Local should fail");
+			Assert.IsTrue (nav.MoveToFirstNamespace (XPathNamespaceScope.ExcludeXml), "ExcludeXml should succeed");
 			AssertNavigator ("#7", nav, XPathNodeType.Namespace,
 				"", "", "", "", xhtml, false, false, false);
 
-			Assert (nav.MoveToNextNamespace (XPathNamespaceScope.All));
+			Assert.IsTrue (nav.MoveToNextNamespace (XPathNamespaceScope.All));
 			AssertNavigator ("#8", nav, XPathNodeType.Namespace,
 				"", "xml", "", "xml", xmlNS, false, false, false);
-			Assert (nav.MoveToParent ());
+			Assert.IsTrue (nav.MoveToParent ());
 			AssertNavigator ("#9", nav, XPathNodeType.Element,
 				"", "body", xhtml, "body", "test.", false, true, false);
 
@@ -350,11 +348,11 @@ namespace MonoTests.System.Xml
 			XPathNodeIterator iter = nav.Select ("//e");
 			iter.MoveNext ();
 			nav.MoveTo (iter.Current);
-			AssertEquals ("e", nav.Name);
+			Assert.AreEqual ("e", nav.Name, "#1");
 			nav.MoveToFirstNamespace ();
-			AssertEquals ("x", nav.Name);
+			Assert.AreEqual ("x", nav.Name, "#2");
 			nav.MoveToNextNamespace ();
-			AssertEquals ("xml", nav.Name);
+			Assert.AreEqual ("xml", nav.Name, "#3");
 		}
 
 		[Test]
@@ -373,20 +371,20 @@ namespace MonoTests.System.Xml
 			XPathNavigator tmp = nav.Clone ();
 			XPathNodeIterator iter = nav.Select ("//e");
 			iter.MoveNext ();
-			Assert (nav.MoveTo (iter.Current));
-			Assert (nav.MoveToFirstAttribute ());
-			AssertEquals ("attr", nav.Name);
-			AssertEquals ("", tmp.Name);
-			Assert (tmp.IsDescendant (nav));
-			Assert (!nav.IsDescendant (tmp));
+			Assert.IsTrue (nav.MoveTo (iter.Current), "#1");
+			Assert.IsTrue (nav.MoveToFirstAttribute (), "#2");
+			Assert.AreEqual ("attr", nav.Name, "#3");
+			Assert.AreEqual ("", tmp.Name, "#4");
+			Assert.IsTrue (tmp.IsDescendant (nav), "#5");
+			Assert.IsTrue (!nav.IsDescendant (tmp), "#6");
 			tmp.MoveToFirstChild ();
-			AssertEquals ("a", tmp.Name);
-			Assert (tmp.IsDescendant (nav));
-			Assert (!nav.IsDescendant (tmp));
+			Assert.AreEqual ("a", tmp.Name, "#7");
+			Assert.IsTrue (tmp.IsDescendant (nav), "#8");
+			Assert.IsTrue (!nav.IsDescendant (tmp), "#9");
 			tmp.MoveTo (iter.Current);
-			AssertEquals ("e", tmp.Name);
-			Assert (tmp.IsDescendant (nav));
-			Assert (!nav.IsDescendant (tmp));
+			Assert.AreEqual ("e", tmp.Name, "#10");
+			Assert.IsTrue (tmp.IsDescendant (nav), "#11");
+			Assert.IsTrue (!nav.IsDescendant (tmp), "#12");
 		}
 
 		[Test]
@@ -404,8 +402,8 @@ namespace MonoTests.System.Xml
 		{
 			nav.MoveToFirstChild ();
 			nav.MoveToFirstChild ();
-			AssertEquals (XPathNodeType.Text, nav.NodeType);
-			AssertEquals ("test string", nav.Value);
+			Assert.AreEqual (XPathNodeType.Text, nav.NodeType, "#1");
+			Assert.AreEqual ("test string", nav.Value, "#2");
 		}
 
 		// bug #75609
@@ -424,7 +422,7 @@ namespace MonoTests.System.Xml
 		{
 			nav.MoveToFirstChild (); // root
 			XPathNodeIterator iter = nav.SelectChildren ("foo", "urn:foo");
-			AssertEquals (2, iter.Count);
+			Assert.AreEqual (2, iter.Count, "#1");
 		}
 
 #if NET_2_0
@@ -449,7 +447,7 @@ namespace MonoTests.System.Xml
 			string ret = @"<one>
   <two>Some data.</two>
 </one>";
-			AssertEquals (ret, nav.OuterXml.Replace ("\r\n", "\n"));
+			Assert.AreEqual (ret, nav.OuterXml.Replace ("\r\n", "\n"), "#1");
 		}
 
 		[Test]
@@ -462,7 +460,7 @@ namespace MonoTests.System.Xml
 			var xr = nav.ReadSubtree ();
 			xr.MoveToContent ();
 			xr.Read (); // should be at x:val
-			AssertEquals ("urn:x", xr.LookupNamespace ("x"));
+			Assert.AreEqual ("urn:x", xr.LookupNamespace ("x"), "#1");
 		}
 #endif
 
@@ -483,10 +481,10 @@ namespace MonoTests.System.Xml
 			nav.MoveToFirstChild ();
 			nav.MoveToFirstChild ();
 			nav.MoveToNext ();
-			AssertEquals ("#1." + nav.GetType (), "ns1", nav.GetNamespace (""));
+			Assert.AreEqual ("ns1", nav.GetNamespace (""), "#1." + nav.GetType ());
 			nav.MoveToNext ();
 			nav.MoveToNext ();
-			AssertEquals ("#2." + nav.GetType (), "", nav.GetNamespace (""));
+			Assert.AreEqual ("", nav.GetNamespace (""), "#2." + nav.GetType ());
 		}
 	}
 }

+ 59 - 59
mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorEvaluateTests.cs

@@ -18,7 +18,7 @@ using NUnit.Framework;
 namespace MonoTests.System.Xml
 {
 	[TestFixture]
-	public class XPathNavigatorEvaluateTests : Assertion
+	public class XPathNavigatorEvaluateTests
 	{
 		XmlDocument document;
 		XPathNavigator navigator;
@@ -59,13 +59,13 @@ namespace MonoTests.System.Xml
 		{
 			expression = navigator.Compile("last()");
 			iterator = navigator.Select("/foo");
-			AssertEquals ("1", navigator.Evaluate ("last()").ToString());
-			AssertEquals ("1", navigator.Evaluate (expression, null).ToString ());
-			AssertEquals ("1", navigator.Evaluate (expression, iterator).ToString ());
+			Assert.AreEqual ("1", navigator.Evaluate ("last()").ToString(), "#1");
+			Assert.AreEqual ("1", navigator.Evaluate (expression, null).ToString (), "#2");
+			Assert.AreEqual ("1", navigator.Evaluate (expression, iterator).ToString (), "#3");
 			iterator = navigator.Select("/foo/*");
-			AssertEquals ("4", navigator.Evaluate (expression, iterator).ToString ());
+			Assert.AreEqual ("4", navigator.Evaluate (expression, iterator).ToString (), "#4");
 			
-			AssertEquals("3", navigator2.Evaluate ("string(//bar[last()]/@baz)"));
+			Assert.AreEqual("3", navigator2.Evaluate ("string(//bar[last()]/@baz)"), "#5");
 		}
 
 		[Test]
@@ -82,28 +82,28 @@ namespace MonoTests.System.Xml
 		{
 			expression = navigator.Compile("position()");
 			iterator = navigator.Select("/foo");
-			AssertEquals ("#1", "1", navigator.Evaluate ("position()").ToString ());
-			AssertEquals ("#2", "1", navigator.Evaluate (expression, null).ToString ());
-			AssertEquals ("#3", "0", navigator.Evaluate (expression, iterator).ToString ());
+			Assert.AreEqual ("1", navigator.Evaluate ("position()").ToString (), "#1");
+			Assert.AreEqual ("1", navigator.Evaluate (expression, null).ToString (), "#2");
+			Assert.AreEqual ("0", navigator.Evaluate (expression, iterator).ToString (), "#3");
 			iterator = navigator.Select("/foo/*");
-			AssertEquals ("#4", "0", navigator.Evaluate (expression, iterator).ToString ());
+			Assert.AreEqual ("0", navigator.Evaluate (expression, iterator).ToString (), "#4");
 			iterator.MoveNext();
-			AssertEquals ("#5", "1", navigator.Evaluate (expression, iterator).ToString ());
+			Assert.AreEqual ("1", navigator.Evaluate (expression, iterator).ToString (), "#5");
 			iterator.MoveNext ();
-			AssertEquals ("#6", "2", navigator.Evaluate (expression, iterator).ToString ());
+			Assert.AreEqual ("2", navigator.Evaluate (expression, iterator).ToString (), "#6");
 			iterator.MoveNext ();
-			AssertEquals ("#7", "3", navigator.Evaluate (expression, iterator).ToString ());
+			Assert.AreEqual ("3", navigator.Evaluate (expression, iterator).ToString (), "#7");
 		}
 
 		[Test]
 		public void CoreFunctionNodeSetCount ()
 		{
-			AssertEquals ("5", navigator.Evaluate ("count(//*)").ToString ());
-			AssertEquals ("1", navigator.Evaluate ("count(//foo)").ToString ());
-			AssertEquals ("1", navigator.Evaluate ("count(/foo)").ToString ());
-			AssertEquals ("1", navigator.Evaluate ("count(/foo/bar)").ToString ());
+			Assert.AreEqual ("5", navigator.Evaluate ("count(//*)").ToString (), "#1");
+			Assert.AreEqual ("1", navigator.Evaluate ("count(//foo)").ToString (), "#2");
+			Assert.AreEqual ("1", navigator.Evaluate ("count(/foo)").ToString (), "#3");
+			Assert.AreEqual ("1", navigator.Evaluate ("count(/foo/bar)").ToString (), "#4");
 
-			AssertEquals ("3", navigator2.Evaluate ("count(//bar)").ToString ());
+			Assert.AreEqual ("3", navigator2.Evaluate ("count(//bar)").ToString (), "#5");
 		}
 
 		public void saveTestCoreFunctionNodeSetID ()
@@ -117,17 +117,17 @@ namespace MonoTests.System.Xml
 				"<foo><bar baz='1' qux='hello' /><bar baz='2' qux='world' /></foo>");
 			navigator = document.CreateNavigator();
 
-			AssertEquals ("hello", navigator.Evaluate ("string(id('1')/@qux)").ToString ());
-			AssertEquals ("world", navigator.Evaluate ("string(id('2')/@qux)").ToString ());
+			Assert.AreEqual ("hello", navigator.Evaluate ("string(id('1')/@qux)").ToString (), "#1");
+			Assert.AreEqual ("world", navigator.Evaluate ("string(id('2')/@qux)").ToString (), "#2");
 		}
 
 		[Test]
 		public void CoreFunctionLocalName ()
 		{
-			AssertEquals ("", navigator.Evaluate ("local-name()").ToString ());
-			AssertEquals ("", navigator.Evaluate ("local-name(/bogus)").ToString ());
-			AssertEquals ("foo", navigator.Evaluate ("local-name(/foo)").ToString ());
-			AssertEquals ("bar", navigator3.Evaluate ("local-name(/foo/*)").ToString ());
+			Assert.AreEqual ("", navigator.Evaluate ("local-name()").ToString (), "#1");
+			Assert.AreEqual ("", navigator.Evaluate ("local-name(/bogus)").ToString (), "#2");
+			Assert.AreEqual ("foo", navigator.Evaluate ("local-name(/foo)").ToString (), "#3");
+			Assert.AreEqual ("bar", navigator3.Evaluate ("local-name(/foo/*)").ToString (), "#4");
 		}
 
 		// TODO:  umm.  Unable to make this return a namespace-uri so far...
@@ -137,10 +137,10 @@ namespace MonoTests.System.Xml
 			document.LoadXml ("<foo:bar xmlns:foo='#foo'><foo:baz><foo:qux /></foo:baz></foo:bar>");
 			navigator = document.CreateNavigator ();
 
-			AssertEquals ("", navigator.Evaluate ("namespace-uri()").ToString ());
-			AssertEquals ("", navigator.Evaluate ("namespace-uri(/bogus)").ToString ());
-			//AssertEquals("foo", navigator.Evaluate ("namespace-uri(/bar)").ToString ());
-			AssertEquals ("", navigator2.Evaluate ("namespace-uri(//bar)").ToString ());
+			Assert.AreEqual ("", navigator.Evaluate ("namespace-uri()").ToString (), "#1");
+			Assert.AreEqual ("", navigator.Evaluate ("namespace-uri(/bogus)").ToString (), "#2");
+			//Assert.AreEqual("foo", navigator.Evaluate ("namespace-uri(/bar)").ToString (), "#3");
+			Assert.AreEqual ("", navigator2.Evaluate ("namespace-uri(//bar)").ToString (), "#4");
 		}
 
 		public void saveTestCoreFunctionString ()
@@ -148,28 +148,28 @@ namespace MonoTests.System.Xml
 			document.LoadXml ("<foo>hello<bar>world</bar><baz>how are you</baz></foo>");
 			navigator = document.CreateNavigator ();
 
-			AssertEquals ("world", navigator.Evaluate ("string(/foo/*)").ToString ());
-			AssertEquals ("NaN", navigator.Evaluate ("string(0 div 0)").ToString ());
+			Assert.AreEqual ("world", navigator.Evaluate ("string(/foo/*)").ToString (), "#1");
+			Assert.AreEqual ("NaN", navigator.Evaluate ("string(0 div 0)").ToString (), "#2");
 			
 			try {
 				navigator.Evaluate ("string(+0)");
-				Fail ("Expected an XPathException to be thrown.");
+				Assert.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 			
-			AssertEquals ("0", navigator.Evaluate ("string(-0)").ToString ());			
-			AssertEquals ("Infinity", navigator.Evaluate ("string(1 div 0)").ToString ());
-			AssertEquals ("-Infinity", navigator.Evaluate ("string(-1 div 0)").ToString ());
-			AssertEquals ("45", navigator.Evaluate ("string(45)").ToString ());
-			AssertEquals ("-22", navigator.Evaluate ("string(-22)").ToString ());
-			AssertEquals ("0.25", navigator.Evaluate ("string(.25)").ToString ());
-			AssertEquals ("-0.25", navigator.Evaluate ("string(-.25)").ToString ());
-			AssertEquals ("2", navigator.Evaluate ("string(2.0)").ToString ());
-			AssertEquals ("2.01", navigator.Evaluate ("string(2.01)").ToString ());
-			AssertEquals ("-3", navigator.Evaluate ("string(-3.0)").ToString ());
-			AssertEquals ("3.45", navigator.Evaluate ("string(3.45)").ToString ());
+			Assert.AreEqual ("0", navigator.Evaluate ("string(-0)").ToString (), "#3");
+			Assert.AreEqual ("Infinity", navigator.Evaluate ("string(1 div 0)").ToString (), "#4");
+			Assert.AreEqual ("-Infinity", navigator.Evaluate ("string(-1 div 0)").ToString (), "#5");
+			Assert.AreEqual ("45", navigator.Evaluate ("string(45)").ToString (), "#6");
+			Assert.AreEqual ("-22", navigator.Evaluate ("string(-22)").ToString (), "#7");
+			Assert.AreEqual ("0.25", navigator.Evaluate ("string(.25)").ToString (), "#8");
+			Assert.AreEqual ("-0.25", navigator.Evaluate ("string(-.25)").ToString (), "#9");
+			Assert.AreEqual ("2", navigator.Evaluate ("string(2.0)").ToString (), "#10");
+			Assert.AreEqual ("2.01", navigator.Evaluate ("string(2.01)").ToString (), "#11");
+			Assert.AreEqual ("-3", navigator.Evaluate ("string(-3.0)").ToString (), "#12");
+			Assert.AreEqual ("3.45", navigator.Evaluate ("string(3.45)").ToString (), "#13");
 
 			// Wonder what this will look like under a different platform.
-			AssertEquals("0.33333333333333331", navigator.Evaluate ("string(1 div 3)").ToString ());
+			Assert.AreEqual("0.33333333333333331", navigator.Evaluate ("string(1 div 3)").ToString (), "#14");
 		}
 
 		[Test]
@@ -177,18 +177,18 @@ namespace MonoTests.System.Xml
 		{
 			try {
 				navigator.Evaluate ("concat()");
-				Fail ("Expected an XPathException to be thrown.");
+				Assert.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
 			try {
 				navigator.Evaluate ("concat('foo')");
-				Fail ("Expected an XPathException to be thrown.");
+				Assert.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
-			AssertEquals ("foobar", navigator.Evaluate ("concat('foo', 'bar')").ToString ());
-			AssertEquals ("foobarbaz", navigator.Evaluate ("concat('foo', 'bar', 'baz')").ToString ());
-			AssertEquals ("foobarbazqux", navigator.Evaluate ("concat('foo', 'bar', 'baz', 'qux')").ToString ());
-			AssertEquals ("foobarbazquxquux", navigator.Evaluate ("concat('foo', 'bar', 'baz', 'qux', 'quux')").ToString ());
+			Assert.AreEqual ("foobar", navigator.Evaluate ("concat('foo', 'bar')").ToString (), "#1");
+			Assert.AreEqual ("foobarbaz", navigator.Evaluate ("concat('foo', 'bar', 'baz')").ToString (), "#2");
+			Assert.AreEqual ("foobarbazqux", navigator.Evaluate ("concat('foo', 'bar', 'baz', 'qux')").ToString (), "#3");
+			Assert.AreEqual ("foobarbazquxquux", navigator.Evaluate ("concat('foo', 'bar', 'baz', 'qux', 'quux')").ToString (), "#4");
 		}
 
 		[Test]
@@ -196,21 +196,21 @@ namespace MonoTests.System.Xml
 		{
 			try {
 				navigator.Evaluate ("starts-with()");
-				Fail ("Expected an XPathException to be thrown.");
+				Assert.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
 			try {
 				navigator.Evaluate ("starts-with('foo')");
-				Fail ("Expected an XPathException to be thrown.");
+				Assert.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
 			try {
 				navigator.Evaluate ("starts-with('foo', 'bar', 'baz')");
-				Fail ("Expected an XPathException to be thrown.");
+				Assert.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
-			Assert ((bool)navigator.Evaluate ("starts-with('foobar', 'foo')"));
-			Assert (!(bool)navigator.Evaluate ("starts-with('foobar', 'bar')"));
+			Assert.IsTrue ((bool)navigator.Evaluate ("starts-with('foobar', 'foo')"));
+			Assert.IsTrue (!(bool)navigator.Evaluate ("starts-with('foobar', 'bar')"));
 		}
 
 		[Test]
@@ -218,21 +218,21 @@ namespace MonoTests.System.Xml
 		{
 			try {
 				navigator.Evaluate ("contains()");
-				Fail ("Expected an XPathException to be thrown.");
+				Assert.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
 			try {
 				navigator.Evaluate ("contains('foo')");
-				Fail ("Expected an XPathException to be thrown.");
+				Assert.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
 			try {
 				navigator.Evaluate ("contains('foobar', 'oob', 'baz')");
-				Fail ("Expected an XPathException to be thrown.");
+				Assert.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
-			Assert ((bool)navigator.Evaluate ("contains('foobar', 'oob')"));
-			Assert (!(bool)navigator.Evaluate ("contains('foobar', 'baz')"));
+			Assert.IsTrue ((bool)navigator.Evaluate ("contains('foobar', 'oob')"));
+			Assert.IsTrue (!(bool)navigator.Evaluate ("contains('foobar', 'baz')"));
 		}
 	}
 }

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

@@ -22,7 +22,7 @@ using NUnit.Framework;
 namespace MonoTests.System.Xml
 {
 	[TestFixture]
-	public class XPathNavigatorTests : Assertion
+	public class XPathNavigatorTests
 	{
 		XmlDocument document;
 		XPathNavigator navigator;
@@ -38,7 +38,7 @@ namespace MonoTests.System.Xml
 		{
 			document.LoadXml ("<foo />");
 			navigator = document.CreateNavigator ();
-			AssertNotNull (navigator);
+			Assert.IsNotNull (navigator);
 		}
 
 		[Test]
@@ -47,14 +47,14 @@ namespace MonoTests.System.Xml
 			document.LoadXml ("<foo:bar xmlns:foo='#foo' />");
 			navigator = document.CreateNavigator ();
 			
-			AssertEquals (XPathNodeType.Root, navigator.NodeType);
-			AssertEquals (String.Empty, navigator.Name);
-			AssertEquals (String.Empty, navigator.LocalName);
-			AssertEquals (String.Empty, navigator.NamespaceURI);
-			AssertEquals (String.Empty, navigator.Prefix);
-			Assert (!navigator.HasAttributes);
-			Assert (navigator.HasChildren);
-			Assert (!navigator.IsEmptyElement);
+			Assert.AreEqual (XPathNodeType.Root, navigator.NodeType, "#1");
+			Assert.AreEqual (String.Empty, navigator.Name, "#2");
+			Assert.AreEqual (String.Empty, navigator.LocalName, "#3");
+			Assert.AreEqual (String.Empty, navigator.NamespaceURI, "#4");
+			Assert.AreEqual (String.Empty, navigator.Prefix, "#5");
+			Assert.IsTrue (!navigator.HasAttributes, "#6");
+			Assert.IsTrue (navigator.HasChildren, "#7");
+			Assert.IsTrue (!navigator.IsEmptyElement, "#8");
 		}
 
 		[Test]
@@ -63,14 +63,14 @@ namespace MonoTests.System.Xml
 			document.LoadXml ("<foo:bar xmlns:foo='#foo' />");
 			navigator = document.DocumentElement.CreateNavigator ();
 			
-			AssertEquals (XPathNodeType.Element, navigator.NodeType);
-			AssertEquals ("foo:bar", navigator.Name);
-			AssertEquals ("bar", navigator.LocalName);
-			AssertEquals ("#foo", navigator.NamespaceURI);
-			AssertEquals ("foo", navigator.Prefix);
-			Assert (!navigator.HasAttributes);
-			Assert (!navigator.HasChildren);
-			Assert (navigator.IsEmptyElement);
+			Assert.AreEqual (XPathNodeType.Element, navigator.NodeType, "#1");
+			Assert.AreEqual ("foo:bar", navigator.Name, "#2");
+			Assert.AreEqual ("bar", navigator.LocalName, "#3");
+			Assert.AreEqual ("#foo", navigator.NamespaceURI, "#4");
+			Assert.AreEqual ("foo", navigator.Prefix, "#5");
+			Assert.IsTrue (!navigator.HasAttributes, "#6");
+			Assert.IsTrue (!navigator.HasChildren, "#7");
+			Assert.IsTrue (navigator.IsEmptyElement, "#8");
 		}
 
 		[Test]
@@ -79,14 +79,14 @@ namespace MonoTests.System.Xml
 			document.LoadXml ("<foo bar:baz='quux' xmlns:bar='#bar' />");
 			navigator = document.DocumentElement.GetAttributeNode("baz", "#bar").CreateNavigator ();
 			
-			AssertEquals (XPathNodeType.Attribute, navigator.NodeType);
-			AssertEquals ("bar:baz", navigator.Name);
-			AssertEquals ("baz", navigator.LocalName);
-			AssertEquals ("#bar", navigator.NamespaceURI);
-			AssertEquals ("bar", navigator.Prefix);
-			Assert (!navigator.HasAttributes);
-			Assert (!navigator.HasChildren);
-			Assert (!navigator.IsEmptyElement);
+			Assert.AreEqual (XPathNodeType.Attribute, navigator.NodeType, "#1");
+			Assert.AreEqual ("bar:baz", navigator.Name, "#2");
+			Assert.AreEqual ("baz", navigator.LocalName, "#3");
+			Assert.AreEqual ("#bar", navigator.NamespaceURI, "#4");
+			Assert.AreEqual ("bar", navigator.Prefix, "#5");
+			Assert.IsTrue (!navigator.HasAttributes, "#6");
+			Assert.IsTrue (!navigator.HasChildren, "#7");
+			Assert.IsTrue (!navigator.IsEmptyElement, "#8");
 		}
 
 		[Test]
@@ -94,7 +94,7 @@ namespace MonoTests.System.Xml
 		{
 			document.LoadXml ("<root xmlns='urn:foo' />");
 			navigator = document.DocumentElement.Attributes [0].CreateNavigator ();
-			AssertEquals (XPathNodeType.Namespace, navigator.NodeType);
+			Assert.AreEqual (XPathNodeType.Namespace, navigator.NodeType, "#1");
 		}
 
 		[Test]
@@ -103,32 +103,32 @@ namespace MonoTests.System.Xml
 			document.LoadXml ("<foo><bar /><baz /></foo>");
 			navigator = document.DocumentElement.CreateNavigator ();
 			
-			AssertEquals ("foo", navigator.Name);
-			Assert (navigator.MoveToFirstChild ());
-			AssertEquals ("bar", navigator.Name);
-			Assert (navigator.MoveToNext ());
-			AssertEquals ("baz", navigator.Name);
-			Assert (!navigator.MoveToNext ());
-			AssertEquals ("baz", navigator.Name);
-			Assert (navigator.MoveToPrevious ());
-			AssertEquals ("bar", navigator.Name);
-			Assert (!navigator.MoveToPrevious ());
-			Assert (navigator.MoveToParent ());
-			AssertEquals ("foo", navigator.Name);
+			Assert.AreEqual ("foo", navigator.Name, "#1");
+			Assert.IsTrue (navigator.MoveToFirstChild (), "#2");
+			Assert.AreEqual ("bar", navigator.Name, "#3");
+			Assert.IsTrue (navigator.MoveToNext (), "#4");
+			Assert.AreEqual ("baz", navigator.Name, "#5");
+			Assert.IsTrue (!navigator.MoveToNext (), "#6");
+			Assert.AreEqual ("baz", navigator.Name, "#7");
+			Assert.IsTrue (navigator.MoveToPrevious (), "#8");
+			Assert.AreEqual ("bar", navigator.Name, "#9");
+			Assert.IsTrue (!navigator.MoveToPrevious (), "#10");
+			Assert.IsTrue (navigator.MoveToParent (), "#11");
+			Assert.AreEqual ("foo", navigator.Name, "#12");
 			navigator.MoveToRoot ();
-			AssertEquals (XPathNodeType.Root, navigator.NodeType);
-			Assert (!navigator.MoveToParent ());
-			AssertEquals (XPathNodeType.Root, navigator.NodeType);
-			Assert (navigator.MoveToFirstChild ());
-			AssertEquals ("foo", navigator.Name);
-			Assert (navigator.MoveToFirst ());
-			AssertEquals ("foo", navigator.Name);
-			Assert (navigator.MoveToFirstChild ());
-			AssertEquals ("bar", navigator.Name);
-			Assert (navigator.MoveToNext ());
-			AssertEquals ("baz", navigator.Name);
-			Assert (navigator.MoveToFirst ());
-			AssertEquals ("bar", navigator.Name);
+			Assert.AreEqual (XPathNodeType.Root, navigator.NodeType, "#13");
+			Assert.IsTrue (!navigator.MoveToParent (), "#14");
+			Assert.AreEqual (XPathNodeType.Root, navigator.NodeType, "#15");
+			Assert.IsTrue (navigator.MoveToFirstChild (), "#16");
+			Assert.AreEqual ("foo", navigator.Name, "#17");
+			Assert.IsTrue (navigator.MoveToFirst (), "#18");
+			Assert.AreEqual ("foo", navigator.Name, "#19");
+			Assert.IsTrue (navigator.MoveToFirstChild (), "#20");
+			Assert.AreEqual ("bar", navigator.Name, "#21");
+			Assert.IsTrue (navigator.MoveToNext (), "#22");
+			Assert.AreEqual ("baz", navigator.Name, "#23");
+			Assert.IsTrue (navigator.MoveToFirst (), "#24");
+			Assert.AreEqual ("bar", navigator.Name, "#25");
 		}
 
 		[Test]
@@ -143,20 +143,20 @@ namespace MonoTests.System.Xml
 			document2.LoadXml ("<foo><bar /></foo>");
 			XPathNavigator navigator2 = document2.DocumentElement.CreateNavigator ();
 
-			AssertEquals ("foo", navigator1a.Name);
-			Assert (navigator1a.MoveToFirstChild ());
-			AssertEquals ("bar", navigator1a.Name);
+			Assert.AreEqual ("foo", navigator1a.Name, "#1");
+			Assert.IsTrue (navigator1a.MoveToFirstChild (), "#2");
+			Assert.AreEqual ("bar", navigator1a.Name, "#3");
 
-			Assert (!navigator1b.IsSamePosition (navigator1a));
-			AssertEquals ("foo", navigator1b.Name);
-			Assert (navigator1b.MoveTo (navigator1a));
-			Assert (navigator1b.IsSamePosition (navigator1a));
-			AssertEquals ("bar", navigator1b.Name);
+			Assert.IsTrue (!navigator1b.IsSamePosition (navigator1a), "#4");
+			Assert.AreEqual ("foo", navigator1b.Name, "#5");
+			Assert.IsTrue (navigator1b.MoveTo (navigator1a), "#6");
+			Assert.IsTrue (navigator1b.IsSamePosition (navigator1a), "#7");
+			Assert.AreEqual ("bar", navigator1b.Name, "#8");
 
-			Assert (!navigator2.IsSamePosition (navigator1a));
-			AssertEquals ("foo", navigator2.Name);
-			Assert (!navigator2.MoveTo (navigator1a));
-			AssertEquals ("foo", navigator2.Name);
+			Assert.IsTrue (!navigator2.IsSamePosition (navigator1a), "#9");
+			Assert.AreEqual ("foo", navigator2.Name, "#10");
+			Assert.IsTrue (!navigator2.MoveTo (navigator1a), "#11");
+			Assert.AreEqual ("foo", navigator2.Name, "#12");
 		}
 
 		[Test]
@@ -165,16 +165,16 @@ namespace MonoTests.System.Xml
 			document.LoadXml ("<foo bar='baz' quux='quuux' />");
 			navigator = document.DocumentElement.CreateNavigator ();
 
-			AssertEquals (XPathNodeType.Element, navigator.NodeType);
-			AssertEquals ("foo", navigator.Name);
-			Assert (navigator.MoveToFirstAttribute ());
-			AssertEquals (XPathNodeType.Attribute, navigator.NodeType);
-			AssertEquals ("bar", navigator.Name);
-			AssertEquals ("baz", navigator.Value);
-			Assert (navigator.MoveToNextAttribute ());
-			AssertEquals (XPathNodeType.Attribute, navigator.NodeType);
-			AssertEquals ("quux", navigator.Name);
-			AssertEquals ("quuux", navigator.Value);
+			Assert.AreEqual (XPathNodeType.Element, navigator.NodeType, "#1");
+			Assert.AreEqual ("foo", navigator.Name, "#2");
+			Assert.IsTrue (navigator.MoveToFirstAttribute (), "#3");
+			Assert.AreEqual (XPathNodeType.Attribute, navigator.NodeType, "#4");
+			Assert.AreEqual ("bar", navigator.Name, "#5");
+			Assert.AreEqual ("baz", navigator.Value, "#6");
+			Assert.IsTrue (navigator.MoveToNextAttribute (), "#7");
+			Assert.AreEqual (XPathNodeType.Attribute, navigator.NodeType, "#8");
+			Assert.AreEqual ("quux", navigator.Name, "#9");
+			Assert.AreEqual ("quuux", navigator.Value, "#10");
 		}
 
 		[Test]
@@ -183,12 +183,12 @@ namespace MonoTests.System.Xml
 			document.LoadXml ("<foo><bar>baz</bar><quux>quuux</quux></foo>");
 			navigator = document.DocumentElement.CreateNavigator ();
 
-			AssertEquals (XPathNodeType.Element, navigator.NodeType);
-			AssertEquals ("foo", navigator.Name);
-			//AssertEquals ("bazquuux", navigator.Value);
+			Assert.AreEqual (XPathNodeType.Element, navigator.NodeType, "#1");
+			Assert.AreEqual ("foo", navigator.Name, "#2");
+			//Assert.AreEqual ("bazquuux", navigator.Value, "#3");
 
 			navigator.MoveToRoot ();
-			//AssertEquals ("bazquuux", navigator.Value);
+			//Assert.AreEqual ("bazquuux", navigator.Value, "#4");
 		}
 
 		[Test]
@@ -199,8 +199,8 @@ namespace MonoTests.System.Xml
 
 			navigator.MoveToRoot ();
 			navigator.MoveToFirstChild ();
-			AssertEquals (XPathNodeType.Element, navigator.NodeType);
-			AssertEquals ("Root", navigator.Name);
+			Assert.AreEqual (XPathNodeType.Element, navigator.NodeType, "#1");
+			Assert.AreEqual ("Root", navigator.Name, "#2");
 		}
 
 		[Test]
@@ -209,12 +209,12 @@ namespace MonoTests.System.Xml
 			document.LoadXml ("<?xml-stylesheet href='foo.xsl' type='text/xsl' ?><foo />");
 			navigator = document.CreateNavigator ();
 
-			Assert (navigator.MoveToFirstChild ());
-			AssertEquals (XPathNodeType.ProcessingInstruction, navigator.NodeType);
-			AssertEquals ("xml-stylesheet", navigator.Name);
+			Assert.IsTrue (navigator.MoveToFirstChild ());
+			Assert.AreEqual (XPathNodeType.ProcessingInstruction, navigator.NodeType, "#1");
+			Assert.AreEqual ("xml-stylesheet", navigator.Name, "#2");
 
 			XPathNodeIterator iter = navigator.SelectChildren (XPathNodeType.Element);
-			AssertEquals (0, iter.Count);
+			Assert.AreEqual (0, iter.Count, "#3");
 		}
 
 		[Test]
@@ -228,7 +228,7 @@ namespace MonoTests.System.Xml
 			node.InnerXml = "<include id='new' />";
 
 			XmlNode new_include = node.SelectSingleNode ("//include");
-			AssertEquals ("<include id=\"new\" />", new_include.OuterXml);
+			Assert.AreEqual ("<include id=\"new\" />", new_include.OuterXml, "#1");
 
 			// In this case 'node2' has parent 'node'
 			doc = new XmlDocument ();
@@ -240,8 +240,8 @@ namespace MonoTests.System.Xml
 			node2.InnerXml = "<include id='new' />";
 
 			new_include = node2.SelectSingleNode ("/");
-			AssertEquals ("<child><grandchild><include id=\"new\" /></grandchild></child>",
-				new_include.OuterXml);
+			Assert.AreEqual ("<child><grandchild><include id=\"new\" /></grandchild></child>",
+				new_include.OuterXml, "#2");
 		}
 
 		[Test]
@@ -251,11 +251,11 @@ namespace MonoTests.System.Xml
 			string xml = dtd + "<root id='aaa'/>";
 			StringReader sr = new StringReader (xml);
 			XPathNavigator nav = new XPathDocument (sr).CreateNavigator ();
-			Assert ("ctor() from TextReader", nav.MoveToId ("aaa"));
+			Assert.IsTrue (nav.MoveToId ("aaa"), "ctor() from TextReader");
 
 			XmlValidatingReader xvr = new XmlValidatingReader (xml, XmlNodeType.Document, null);
 			nav = new XPathDocument (xvr).CreateNavigator ();
-			Assert ("ctor() from XmlValidatingReader", nav.MoveToId ("aaa"));
+			Assert.IsTrue (nav.MoveToId ("aaa"), "ctor() from XmlValidatingReader");
 
 			// FIXME: it seems to result in different in .NET 2.0.
 #if NET_2_0
@@ -263,7 +263,7 @@ namespace MonoTests.System.Xml
 			// When it is XmlTextReader, XPathDocument fails.
 			XmlTextReader xtr = new XmlTextReader (xml, XmlNodeType.Document, null);
 			nav = new XPathDocument (xtr).CreateNavigator ();
-			Assert ("ctor() from XmlTextReader", !nav.MoveToId ("aaa"));
+			Assert.IsTrue ("ctor() from XmlTextReader", !nav.MoveToId ("aaa"), "#3");
 			xtr.Close ();
 #endif
 		}
@@ -280,11 +280,11 @@ namespace MonoTests.System.Xml
 				XmlSpace.Preserve).CreateNavigator ();
 			nav.MoveToFirstChild ();
 			nav.MoveToFirstChild ();
-			AssertEquals ("#1", XPathNodeType.Whitespace, nav.NodeType);
+			Assert.AreEqual (XPathNodeType.Whitespace, nav.NodeType, "#1");
 			nav.MoveToNext ();
 			nav.MoveToFirstChild ();
-			AssertEquals ("#2", XPathNodeType.SignificantWhitespace,
-				nav.NodeType);
+			Assert.AreEqual (XPathNodeType.SignificantWhitespace,
+				nav.NodeType, "#2");
 		}
 
 		[Test]
@@ -304,7 +304,7 @@ namespace MonoTests.System.Xml
 
 			XPathNodeIterator iter = nav.Select ("/root");
 			iter.MoveNext ();
-			AssertEquals ("e", iter.Current.Evaluate (expr));
+			Assert.AreEqual ("e", iter.Current.Evaluate (expr), "#1");
 		}
 
 		class MyContext : XsltContext
@@ -420,11 +420,11 @@ namespace MonoTests.System.Xml
 			nav.MoveToFirstChild (); // root
 			nav.MoveToFirstChild (); // ws
 			nav.MoveToFirstChild (); // '   '
-			AssertEquals ("#1", true, nav.Matches ("text()"));
+			Assert.AreEqual (true, nav.Matches ("text()"), "#1");
 			nav.MoveToParent ();
 			nav.MoveToNext (); // sws
 			nav.MoveToFirstChild (); // ' '
-			AssertEquals ("#2", true, nav.Matches ("text()"));
+			Assert.AreEqual (true, nav.Matches ("text()"), "#2");
 		}
 
 		[Test]
@@ -438,9 +438,9 @@ namespace MonoTests.System.Xml
 			var i = nav.Select ("descendant::*");
 
 			// without this call to get_Count() the bug does not reproduce.
-			AssertEquals ("#1", 1, i.Count);
+			Assert.AreEqual (1, i.Count, "#1");
 
-			Assert ("#2", i.MoveNext ());
+			Assert.IsTrue (i.MoveNext (), "#2");
 		}
 
 #if NET_2_0
@@ -452,9 +452,9 @@ namespace MonoTests.System.Xml
 			doc.LoadXml (xml);
 			XPathNavigator nav = doc.CreateNavigator ();
 			nav.MoveToFirstChild ();
-			AssertEquals ("#1", true, nav.ValueAsBoolean);
+			Assert.AreEqual (true, nav.ValueAsBoolean, "#1");
 			nav.MoveToFirstChild ();
-			AssertEquals ("#2", true, nav.ValueAsBoolean);
+			Assert.AreEqual (true, nav.ValueAsBoolean, "#2");
 		}
 
 		[Test]
@@ -478,9 +478,9 @@ namespace MonoTests.System.Xml
 			doc.LoadXml (xml);
 			XPathNavigator nav = doc.CreateNavigator ();
 			nav.MoveToFirstChild ();
-			AssertEquals ("#1", time, nav.ValueAsDateTime);
+			Assert.AreEqual (time, nav.ValueAsDateTime, "#1");
 			nav.MoveToFirstChild ();
-			AssertEquals ("#2", time, nav.ValueAsDateTime);
+			Assert.AreEqual (time, nav.ValueAsDateTime, "#2");
 		}
 
 		[Test]
@@ -503,9 +503,9 @@ namespace MonoTests.System.Xml
 			doc.LoadXml (xml);
 			XPathNavigator nav = doc.CreateNavigator ();
 			nav.MoveToFirstChild ();
-			AssertEquals ("#1", 3.14159265359, nav.ValueAsDouble);
+			Assert.AreEqual (3.14159265359, nav.ValueAsDouble, "#1");
 			nav.MoveToFirstChild ();
-			AssertEquals ("#2", 3.14159265359, nav.ValueAsDouble);
+			Assert.AreEqual (3.14159265359, nav.ValueAsDouble, "#2");
 		}
 
 		[Test]
@@ -528,9 +528,9 @@ namespace MonoTests.System.Xml
 			doc.LoadXml (xml);
 			XPathNavigator nav = doc.CreateNavigator ();
 			nav.MoveToFirstChild ();
-			AssertEquals ("#1", 1, nav.ValueAsInt);
+			Assert.AreEqual (1, nav.ValueAsInt, "#1");
 			nav.MoveToFirstChild ();
-			AssertEquals ("#2", 1, nav.ValueAsInt);
+			Assert.AreEqual (1, nav.ValueAsInt, "#2");
 		}
 
 		[Test]
@@ -554,9 +554,9 @@ namespace MonoTests.System.Xml
 			doc.LoadXml (xml);
 			XPathNavigator nav = doc.CreateNavigator ();
 			nav.MoveToFirstChild ();
-			AssertEquals ("#1", 10000000000000000, nav.ValueAsLong);
+			Assert.AreEqual (10000000000000000, nav.ValueAsLong, "#1");
 			nav.MoveToFirstChild ();
-			AssertEquals ("#2", 10000000000000000, nav.ValueAsLong);
+			Assert.AreEqual (10000000000000000, nav.ValueAsLong, "#2");
 		}
 
 		[Test]
@@ -580,12 +580,12 @@ namespace MonoTests.System.Xml
 			XPathNavigator nav = doc.CreateNavigator ();
 			XPathNodeIterator iter = nav.Select ("/Abc/Foo");
 			iter.MoveNext ();
-			AssertEquals ("#1", "Hello", iter.Current.InnerXml);
-			AssertEquals ("#2", "<Foo>Hello</Foo>", iter.Current.OuterXml);
+			Assert.AreEqual ("Hello", iter.Current.InnerXml, "#1");
+			Assert.AreEqual ("<Foo>Hello</Foo>", iter.Current.OuterXml, "#2");
 			iter = nav.Select ("/Abc/Foo/text()");
 			iter.MoveNext ();
-			AssertEquals ("#3", String.Empty, iter.Current.InnerXml);
-			AssertEquals ("#4", "Hello", iter.Current.OuterXml);
+			Assert.AreEqual (String.Empty, iter.Current.InnerXml, "#3");
+			Assert.AreEqual ("Hello", iter.Current.OuterXml, "#4");
 		}
 
 		[Test] // bug #79875
@@ -597,7 +597,7 @@ namespace MonoTests.System.Xml
 
 			XPathNodeIterator iter = nav.Select ("/Abc/Foo/@attr");
 			iter.MoveNext ();
-			AssertEquals ("val1", iter.Current.InnerXml);
+			Assert.AreEqual ("val1", iter.Current.InnerXml, "#1");
 		}
 
 		[Test]
@@ -608,12 +608,12 @@ namespace MonoTests.System.Xml
 			XPathNavigator nav = doc.CreateNavigator ();
 			XPathNodeIterator iter = nav.Select ("/Abc/Foo");
 			iter.MoveNext ();
-			AssertEquals ("#1", "Hello&lt;\r\nInnerXml", iter.Current.InnerXml);
-			AssertEquals ("#2", "<Foo>Hello&lt;\r\nInnerXml</Foo>", iter.Current.OuterXml);
+			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 ();
-			AssertEquals ("#3", String.Empty, iter.Current.InnerXml);
-			AssertEquals ("#4", "Hello&lt;\r\nInnerXml", iter.Current.OuterXml);
+			Assert.AreEqual (String.Empty, iter.Current.InnerXml, "#3");
+			Assert.AreEqual ("Hello&lt;\r\nInnerXml", iter.Current.OuterXml, "#4");
 		}
 
 		[Test]
@@ -626,7 +626,7 @@ namespace MonoTests.System.Xml
 
 			XPathNodeIterator iter = nav.Select ("/Abc/Foo/@attr");
 			iter.MoveNext ();
-			AssertEquals ("val&quot;1&#10;&gt;", iter.Current.InnerXml);
+			Assert.AreEqual ("val&quot;1&#10;&gt;", iter.Current.InnerXml, "#1");
 		}
 
 		[Test]
@@ -636,14 +636,14 @@ namespace MonoTests.System.Xml
 			XmlWriter w = doc.CreateNavigator ().AppendChild ();
 			w.WriteStartElement ("foo");
 			w.WriteAttributeString ("xmlns", "x", "http://www.w3.org/2000/xmlns/", "urn:foo");
-			AssertEquals ("#0", "x", w.LookupPrefix ("urn:foo"));
+			Assert.AreEqual ("x", w.LookupPrefix ("urn:foo"), "#0");
 			w.WriteStartElement (null, "bar", "urn:foo");
 			w.WriteAttributeString (null, "ext", "urn:foo", "bah");
 			w.WriteEndElement ();
 			w.WriteEndElement ();
 			w.Close ();
-			AssertEquals ("#1", "x", doc.FirstChild.FirstChild.Prefix);
-			AssertEquals ("#2", "x", doc.FirstChild.FirstChild.Attributes [0].Prefix);
+			Assert.AreEqual ("x", doc.FirstChild.FirstChild.Prefix, "#1");
+			Assert.AreEqual ("x", doc.FirstChild.FirstChild.Attributes [0].Prefix, "#2");
 		}
 
 		[Test]
@@ -653,8 +653,8 @@ namespace MonoTests.System.Xml
 			XPathNavigator nav = new XPathDocument (XmlReader.Create (new StringReader (xml))).CreateNavigator ();
 			nav.MoveToFirstChild ();
 			nav.MoveToFirstChild ();
-			AssertEquals ("1", nav.ValueAs (typeof (string), null));
-			AssertEquals (1, nav.ValueAs (typeof (int), null));
+			Assert.AreEqual ("1", nav.ValueAs (typeof (string), null), "#1");
+			Assert.AreEqual (1, nav.ValueAs (typeof (int), null), "#2");
 		}
 
 		[Test]
@@ -663,11 +663,11 @@ namespace MonoTests.System.Xml
 			XmlDocument doc = new XmlDocument ();
 			doc.LoadXml ("<root><child/><child2/></root>");
 			XPathNavigator nav = doc.CreateNavigator ();
-			Assert ("#1", nav.MoveToFollowing (XPathNodeType.All));
-			Assert ("#2", nav.MoveToFollowing (XPathNodeType.All));
-			AssertEquals ("#3", "child", nav.LocalName);
-			Assert ("#4", nav.MoveToNext (XPathNodeType.All));
-			AssertEquals ("#5", "child2", nav.LocalName);
+			Assert.IsTrue (nav.MoveToFollowing (XPathNodeType.All), "#1");
+			Assert.IsTrue (nav.MoveToFollowing (XPathNodeType.All), "#2");
+			Assert.AreEqual ("child", nav.LocalName, "#3");
+			Assert.IsTrue (nav.MoveToNext (XPathNodeType.All), "#4");
+			Assert.AreEqual ("child2", nav.LocalName, "#5");
 		}
 
 		[Test] // bug #324606.
@@ -688,7 +688,7 @@ namespace MonoTests.System.Xml
 </child1>
 <child2 />
 <child3 />";
-			AssertEquals (result, n.OuterXml.Replace ("\r\n", "\n"));
+			Assert.AreEqual (result, n.OuterXml.Replace ("\r\n", "\n"), "#1");
 		}
 
 		[Test] // bug #376191
@@ -702,7 +702,7 @@ namespace MonoTests.System.Xml
 			<node>q</node>
 			</test>");
 			XPathNavigator navigator = document.CreateNavigator();
-			AssertEquals (navigator.OuterXml, navigator.InnerXml);
+			Assert.AreEqual (navigator.OuterXml, navigator.InnerXml, "#1");
 		}
 #endif
 	}