Parcourir la source

* Removed AllTests.cs and TheTests.cs
* NUnit20ified NameTableTests.cs, SelectNodesTests.cs,
XmlAttributeCollectionTests.cs, XmlAttributeTests.cs,
XmlCDataSectionTests.cs, XmlCharacterDataTests.cs,
XmlCommentTests.cs, XmlDeclarationTests.cs,
XmlDocumentFragmentTests.cs, XmlDocumentTests.cs,
XmlDocumentTypeTests.cs, XmlElementTests.cs,
XmlEntityReferenceTests.cs, XmlNamespaceManagerTests.cs,
XmlNodeListTests.cs, XmlNodeReaderTests.cs,
XmlNodeTests.cs, XmlProcessingInstructionTests.cs,
XmlSignificantWhitespaceTests.cs, XmlTextReaderTests.cs,
XmlTextTests.cs, XmlTextWriterTests.cs,
XmlWhiteSpaceTests.cs, XmlWriterTests.cs,
XPathNavigatorEvaluateTests.cs, XPathNavigatorMatchesTests.cs,
XPathNavigatorTests.cs, makefile.gnu, System.XML_linux_test.args
* Commited Atsushi Eno changes to System.XML_test.build

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

Martin Willemoes Hansen il y a 23 ans
Parent
commit
fb585dffda
33 fichiers modifiés avec 1863 ajouts et 1713 suppressions
  1. 0 53
      mcs/class/System.XML/Test/AllTests.cs
  2. 18 0
      mcs/class/System.XML/Test/ChangeLog
  3. 23 19
      mcs/class/System.XML/Test/NameTableTests.cs
  4. 103 81
      mcs/class/System.XML/Test/SelectNodesTests.cs
  5. 4 11
      mcs/class/System.XML/Test/System.XML_linux_test.args
  6. 5 4
      mcs/class/System.XML/Test/System.XML_test.build
  7. 0 93
      mcs/class/System.XML/Test/TheTests.cs
  8. 82 73
      mcs/class/System.XML/Test/XPathNavigatorEvaluateTests.cs
  9. 37 27
      mcs/class/System.XML/Test/XPathNavigatorMatchesTests.cs
  10. 97 89
      mcs/class/System.XML/Test/XPathNavigatorTests.cs
  11. 46 38
      mcs/class/System.XML/Test/XmlAttributeCollectionTests.cs
  12. 54 42
      mcs/class/System.XML/Test/XmlAttributeTests.cs
  13. 34 34
      mcs/class/System.XML/Test/XmlCDataSectionTests.cs
  14. 42 38
      mcs/class/System.XML/Test/XmlCharacterDataTests.cs
  15. 33 28
      mcs/class/System.XML/Test/XmlCommentTests.cs
  16. 55 49
      mcs/class/System.XML/Test/XmlDeclarationTests.cs
  17. 28 29
      mcs/class/System.XML/Test/XmlDocumentFragmentTests.cs
  18. 249 215
      mcs/class/System.XML/Test/XmlDocumentTests.cs
  19. 33 31
      mcs/class/System.XML/Test/XmlDocumentTypeTests.cs
  20. 98 78
      mcs/class/System.XML/Test/XmlElementTests.cs
  21. 9 12
      mcs/class/System.XML/Test/XmlEntityReferenceTests.cs
  22. 55 48
      mcs/class/System.XML/Test/XmlNamespaceManagerTests.cs
  23. 72 57
      mcs/class/System.XML/Test/XmlNodeListTests.cs
  24. 62 57
      mcs/class/System.XML/Test/XmlNodeReaderTests.cs
  25. 50 42
      mcs/class/System.XML/Test/XmlNodeTests.cs
  26. 11 9
      mcs/class/System.XML/Test/XmlProcessingInstructionTests.cs
  27. 43 34
      mcs/class/System.XML/Test/XmlSignificantWhitespaceTests.cs
  28. 178 141
      mcs/class/System.XML/Test/XmlTextReaderTests.cs
  29. 19 16
      mcs/class/System.XML/Test/XmlTextTests.cs
  30. 257 207
      mcs/class/System.XML/Test/XmlTextWriterTests.cs
  31. 39 31
      mcs/class/System.XML/Test/XmlWhiteSpaceTests.cs
  32. 11 16
      mcs/class/System.XML/Test/XmlWriterTests.cs
  33. 16 11
      mcs/class/System.XML/Test/makefile.gnu

+ 0 - 53
mcs/class/System.XML/Test/AllTests.cs

@@ -1,53 +0,0 @@
-// Author:
-//   Mario Martinez ([email protected])
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
-	/// <summary>
-	///   Combines all unit tests for the System.XML.dll assembly
-	///   into one test suite.
-	/// </summary>
-	public class AllTests : TestCase
-	{
-		public AllTests (string name) : base (name) {}
-
-		public static ITest Suite {
-			get {
-				TestSuite suite =  new TestSuite ();
-				suite.AddTest (new TestSuite (typeof (XmlProcessingInstructionTests)));
-				suite.AddTest (new TestSuite (typeof (XmlTextTests)));
-				suite.AddTest (new TestSuite (typeof (XmlTextReaderTests)));
-				suite.AddTest (new TestSuite (typeof (XmlWriterTests)));
-				suite.AddTest (new TestSuite (typeof (XmlTextWriterTests)));
-				suite.AddTest (new TestSuite (typeof (XmlNodeReaderTests)));
-				suite.AddTest (new TestSuite (typeof (XmlNamespaceManagerTests)));
-				suite.AddTest (new TestSuite (typeof (XmlAttributeTests)));
-				suite.AddTest (new TestSuite (typeof (XmlAttributeCollectionTests)));
-				suite.AddTest (new TestSuite (typeof (XmlDocumentTests)));
-				suite.AddTest (new TestSuite (typeof (XmlDocumentFragmentTests)));
-				suite.AddTest (new TestSuite (typeof (NameTableTests)));
-				suite.AddTest (new TestSuite (typeof (XmlElementTests)));
-				suite.AddTest (new TestSuite (typeof (XmlEntityReferenceTests)));
-				suite.AddTest (new TestSuite (typeof (XmlNodeTests)));
-				suite.AddTest (new TestSuite (typeof (XmlNodeListTests)));
-				suite.AddTest (new TestSuite (typeof (XmlCharacterDataTests)));
-				suite.AddTest (new TestSuite (typeof (XmlCommentTests)));
-				suite.AddTest (new TestSuite (typeof (XmlCDataSectionTests)));
-				suite.AddTest (new TestSuite (typeof (XmlWhitespaceTests)));
-				suite.AddTest (new TestSuite (typeof (XmlSignificantWhitespaceTests)));
-				suite.AddTest (new TestSuite (typeof (XmlDeclarationTests)));
-				suite.AddTest (new TestSuite (typeof (XmlDocumentTypeTests)));
-				suite.AddTest (new TestSuite (typeof (XPathNavigatorTests)));
-				suite.AddTest (new TestSuite (typeof (SelectNodesTests)));
-				suite.AddTest (new TestSuite (typeof (XPathNavigatorMatchesTests)));
-				suite.AddTest (new TestSuite (typeof (XPathNavigatorEvaluateTests)));
-				return suite;
-			}
-		}
-	}
-}

+ 18 - 0
mcs/class/System.XML/Test/ChangeLog

@@ -1,3 +1,21 @@
+2003-03-13  Martin Willemoes Hansen <[email protected]>
+	* Removed AllTests.cs and TheTests.cs
+	* NUnit20ified NameTableTests.cs, SelectNodesTests.cs,
+          XmlAttributeCollectionTests.cs, XmlAttributeTests.cs,
+          XmlCDataSectionTests.cs, XmlCharacterDataTests.cs,
+          XmlCommentTests.cs, XmlDeclarationTests.cs,
+          XmlDocumentFragmentTests.cs, XmlDocumentTests.cs,
+          XmlDocumentTypeTests.cs, XmlElementTests.cs,
+          XmlEntityReferenceTests.cs, XmlNamespaceManagerTests.cs,
+          XmlNodeListTests.cs, XmlNodeReaderTests.cs,
+          XmlNodeTests.cs, XmlProcessingInstructionTests.cs,
+          XmlSignificantWhitespaceTests.cs, XmlTextReaderTests.cs,
+          XmlTextTests.cs, XmlTextWriterTests.cs,
+          XmlWhiteSpaceTests.cs, XmlWriterTests.cs,
+          XPathNavigatorEvaluateTests.cs, XPathNavigatorMatchesTests.cs,
+          XPathNavigatorTests.cs, makefile.gnu, System.XML_linux_test.args 
+	* Commited Atsushi Eno changes to System.XML_test.build
+	
 2003-02-16  Atsushi Enomoto <[email protected]>
 
 	* XmlDocumentTests.cs: added TestLoadExternalUri

+ 23 - 19
mcs/class/System.XML/Test/NameTableTests.cs

@@ -2,8 +2,10 @@
 // System.Xml.NameTableTests.cs
 //
 // Author: Duncan Mak ([email protected])
+// Author: Martin Willemoes Hansen ([email protected])
 //
 // (C) Ximian, Inc.
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -13,16 +15,13 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class NameTableTests : TestCase
+	[TestFixture]
+	public class NameTableTests
 	{
 		NameTable table;
 		
-		public NameTableTests (string name)
-			: base (name)
-		{
-		}
-
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			table = new NameTable ();
 		}
@@ -30,42 +29,46 @@ namespace MonoTests.System.Xml
 		//
 		// Tests System.Xml.NameTable.Add (string)
 		//		
-		public void TestAdd1 ()
+		[Test]
+		public void Add1 ()
 		{
 			string add = "add1";
 			string testAdd = table.Add (add);
-			AssertEquals (add, testAdd);
-			AssertSame (add, testAdd);
+			Assertion.AssertEquals (add, testAdd);
+			Assertion.AssertSame (add, testAdd);
 		}
 
 		//
 		// Tests System.Xml.NameTable.Add (char[], int, int)
 		//		
-		public void TestAdd2 ()
+		[Test]
+		public void Add2 ()
 		{
 			char[] test = new char [4] { 'a', 'd', 'd', '2' };
 			int index = 0;
 			int length = 3; // "add"			
 
-			AssertEquals ("add", table.Add (test, index, length));
+			Assertion.AssertEquals ("add", table.Add (test, index, length));
 		}
 
 		//
 		// Tests System.Xml.NameTable.Get (string)
 		//
-		public void TestGet1 ()
+		[Test]
+		public void Get1 ()
 		{
 			string get1 = "get1";
 			string testGet = table.Add (get1);			
 
-			AssertEquals (table.Get (get1), testGet);
-			AssertSame (get1, testGet );
+			Assertion.AssertEquals (table.Get (get1), testGet);
+			Assertion.AssertSame (get1, testGet );
 		}
 
 		//
 		// Tests System.Xml.NameTable.Get (char[], int, int)
 		//
-		public void TestGet2 ()
+		[Test]
+		public void Get2 ()
 		{						
 			char[] test = new char [4] { 'g', 'e', 't', '2' };
 			int index = 0; 
@@ -73,19 +76,20 @@ namespace MonoTests.System.Xml
 			
 			string testGet = table.Add (test, index, length);			
 
-			AssertEquals (table.Get (test, index, length), testGet);
+			Assertion.AssertEquals (table.Get (test, index, length), testGet);
 		}
 
 		//
 		// Tests System.Xml.NameTable.Get (char[], int, 0)
 		//
-		public void TestGet3 ()
+		[Test]
+		public void Get3 ()
 		{
 			char[] test = new char [4] { 't', 'e', 's', 't' };
 			int index = 0;
 			int length = 0;
 
-			AssertEquals (table.Get (test, index, length), String.Empty);
+			Assertion.AssertEquals (table.Get (test, index, length), String.Empty);
 		}
 	}
 }

+ 103 - 81
mcs/class/System.XML/Test/SelectNodesTests.cs

@@ -1,12 +1,13 @@
 //
 // MonoTests.System.Xml.SelectNodesTests
 //
-// Author:
-//   Jason Diamond <[email protected]>
+// Author: Jason Diamond <[email protected]>
+// Author: Martin Willemoes Hansen <[email protected]>
 //
 // (C) 2002 Jason Diamond
+// (C) 2003 Martin Willemoes Hansen
 //
-
+
 using System;
 using System.Xml;
 
@@ -14,225 +15,246 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class SelectNodesTests : TestCase
+	[TestFixture]
+	public class SelectNodesTests
 	{
-		public SelectNodesTests () : base ("MonoTests.System.Xml.SelectNodesTests testsuite") {}
-		public SelectNodesTests (string name) : base (name) {}
 
-		public void TestRoot ()
+		[Test]
+		public void Root ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XmlNodeList nodes = document.SelectNodes ("/");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document, nodes [0]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document, nodes [0]);
 		}
 
-		public void TestDocumentElement ()
+		[Test]
+		public void DocumentElement ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XmlNodeList nodes = document.SelectNodes ("/foo");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement, nodes [0]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement, nodes [0]);
 		}
 
-		public void TestBadDocumentElement ()
+		[Test]
+		public void BadDocumentElement ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XmlNodeList nodes = document.SelectNodes ("/bar");
-			AssertEquals (0, nodes.Count);
+			Assertion.AssertEquals (0, nodes.Count);
 		}
 
-		public void TestElementWildcard ()
+		[Test]
+		public void ElementWildcard ()
 		{
 			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]);
+			Assertion.AssertEquals (2, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [1], nodes [1]);
 		}
 
-		public void TestOneChildElement ()
+		[Test]
+		public void OneChildElement ()
 		{
 			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]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
 		}
 
-		public void TestOneOtherChildElement ()
+		[Test]
+		public void OneOtherChildElement ()
 		{
 			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]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [1], nodes [0]);
 		}
 
-		public void TestTextNode ()
+		[Test]
+		public void TextNode ()
 		{
 			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]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
 		}
 
-		public void TestSplitTextNodes ()
+		[Test]
+		public void SplitTextNodes ()
 		{
 			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]);
+			Assertion.AssertEquals (2, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [2], nodes [1]);
 		}
 
-		public void TestAbbreviatedParentAxis ()
+		[Test]
+		public void AbbreviatedParentAxis ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /></foo>");
 			XmlNodeList nodes = document.SelectNodes ("/foo/bar/..");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement, nodes [0]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement, nodes [0]);
 		}
 
-		public void TestFullParentAxis ()
+		[Test]
+		public void FullParentAxis ()
 		{
 			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]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement, nodes [0]);
 		}
 
-		public void TestAbbreviatedAttributeAxis ()
+		[Test]
+		public void AbbreviatedAttributeAxis ()
 		{
 			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]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.Attributes ["bar"], nodes [0]);
 		}
 
-		public void TestFullAttributeAxis ()
+		[Test]
+		public void FullAttributeAxis ()
 		{
 			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]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.Attributes ["bar"], nodes [0]);
 		}
 
-		public void TestAbbreviatedAttributeWildcard ()
+		[Test]
+		public void AbbreviatedAttributeWildcard ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo bar='baz' quux='quuux' />");
 			XmlNodeList nodes = document.SelectNodes ("/foo/@*");
-			AssertEquals (2, nodes.Count);
+			Assertion.AssertEquals (2, nodes.Count);
 			// 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]);
+			Assertion.AssertSame (document.DocumentElement.Attributes ["bar"], nodes [0]);
+			Assertion.AssertSame (document.DocumentElement.Attributes ["quux"], nodes [1]);
 		}
 
-		public void TestAttributeParent ()
+		[Test]
+		public void AttributeParent ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo bar='baz' />");
 			XmlNodeList nodes = document.SelectNodes ("/foo/@bar/..");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement, nodes [0]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement, nodes [0]);
 		}
 		
-		public void TestUnionOperator ()
+		[Test]
+		public void UnionOperator ()
 		{
 			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]);
+			Assertion.AssertEquals (2, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [1], nodes [1]);
 		}
 		
-		public void TestNodeWildcard ()
+		[Test]
+		public void NodeWildcard ()
 		{
 			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]);
+			Assertion.AssertEquals (3, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [1], nodes [1]);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [2], nodes [2]);
 		}
 
-		public void TestPositionalPredicate ()
+		[Test]
+		public void PositionalPredicate ()
 		{
 			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]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [0], nodes [0]);
 		}
 
-		public void TestAllFollowingSiblings ()
+		[Test]
+		public void AllFollowingSiblings ()
 		{
 			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]);
+			Assertion.AssertEquals (2, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [1], nodes [0]);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [2], nodes [1]);
 		}
 
-		public void TestFollowingSiblingBaz ()
+		[Test]
+		public void FollowingSiblingBaz ()
 		{
 			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]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [1], nodes [0]);
 		}
 
-		public void TestFollowingSiblingQuux ()
+		[Test]
+		public void FollowingSiblingQuux ()
 		{
 			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]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement.ChildNodes [2], nodes [0]);
 		}
 
-		public void TestUnion ()
+		[Test]
+		public void Union ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XmlNodeList nodes = document.SelectNodes ("(/foo) | (/foo)");
-			AssertEquals (1, nodes.Count);	// bug #27548
-			AssertSame (document.DocumentElement, nodes [0]);
+			Assertion.AssertEquals (1, nodes.Count);	// bug #27548
+			Assertion.AssertSame (document.DocumentElement, nodes [0]);
 		}
 
-		public void TestAlphabetDigitMixedName ()
+		[Test]
+		public void AlphabetDigitMixedName ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo1 />");
 			XmlNodeList nodes = document.SelectNodes ("/foo1");
-			AssertEquals (1, nodes.Count);
-			AssertSame (document.DocumentElement, nodes [0]);
+			Assertion.AssertEquals (1, nodes.Count);
+			Assertion.AssertSame (document.DocumentElement, nodes [0]);
 		}
 
-
-		public void TestNamespaceSelect()
+		[Test]
+		public void NamespaceSelect()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<root xmlns=\"urn:foo1:foo2\"/>");
 			XmlNamespaceManager nsmgr = new XmlNamespaceManager(document.NameTable);
 			nsmgr.AddNamespace("foons", "urn:foo1:foo2");
 			XmlNodeList nodes = document.SelectNodes ("/foons:root", nsmgr);
-			AssertEquals (1, nodes.Count);
+			Assertion.AssertEquals (1, nodes.Count);
 		}
 	}
 }

+ 4 - 11
mcs/class/System.XML/Test/System.XML_linux_test.args

@@ -1,10 +1,3 @@
---target library
--o System.XML_linux_test.dll
---noconfig
--r ../../lib/corlib.dll
--r ../../lib/System.dll
--r ../../../nunit/NUnitCore_mono.dll
-AllTests.cs
 NameTableTests.cs
 SelectNodesTests.cs
 XmlAttributeCollectionTests.cs
@@ -13,22 +6,22 @@ XmlCDataSectionTests.cs
 XmlCharacterDataTests.cs
 XmlCommentTests.cs
 XmlDeclarationTests.cs
-XmlDocumentTests.cs
 XmlDocumentFragmentTests.cs
+XmlDocumentTests.cs
 XmlDocumentTypeTests.cs
 XmlElementTests.cs
 XmlEntityReferenceTests.cs
 XmlNamespaceManagerTests.cs
 XmlNodeListTests.cs
-XmlNodeTests.cs
 XmlNodeReaderTests.cs
+XmlNodeTests.cs
 XmlProcessingInstructionTests.cs
 XmlSignificantWhitespaceTests.cs
 XmlTextReaderTests.cs
 XmlTextTests.cs
 XmlTextWriterTests.cs
-XmlWriterTests.cs
 XmlWhiteSpaceTests.cs
+XmlWriterTests.cs
 XPathNavigatorEvaluateTests.cs
-XPathNavigatorTests.cs
 XPathNavigatorMatchesTests.cs
+XPathNavigatorTests.cs

+ 5 - 4
mcs/class/System.XML/Test/System.XML_test.build

@@ -6,7 +6,7 @@
 
 <project name="System.XML_test" default="build">
 	<property name="debug" value="false"/>
-	<property name="nunit_home" value="..\..\..\nunit"/>
+	<property name="nunit_home" value="..\..\..\nunit20"/>
 
 	<target name="build">
 	</target>
@@ -16,17 +16,18 @@
 			<arg value="/nowarn:1595"/>
 			<sources>
 				<includes name="**/*.cs"/>
+				<excludes name="AllTests.cs"/>
 				<excludes name="TheTests.cs"/>
 			</sources>
-			<references basedir="..\..\..\nunit">
-				<includes name="NUnitCore.dll"/>
+			<references basedir="..\..\..\nunit20">
+				<includes name="NUnit.Framework.dll"/>
 			</references>
 			<arg value="/r:.\System.XML.dll"/>
 		</csc>
 	</target>
 
 	<target name="test" depends="assemblies">
-		<exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.System.Xml.AllTests,System.XML_test.dll" failonerror="false"/>
+		<exec program="..\..\..\nunit20\nunit-console.exe" commandline="System.XML_test.dll" failonerror="false"/>
 	</target>
 
 	<target name="clean">

+ 0 - 93
mcs/class/System.XML/Test/TheTests.cs

@@ -1,93 +0,0 @@
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System.Xml
-{
-	public class RunXmlTextReaderTests : XmlTextReaderTests
-	{
-		protected override void RunTest ()
-		{
-			TestEmptyElement ();
-			TestEmptyElementWithWhitespace ();
-			TestEmptyElementWithStartAndEndTag ();
-			TestEmptyElementWithStartAndEndTagWithWhitespace ();
-			TestNestedEmptyTag ();
-			TestNestedText ();
-			TestEmptyElementWithAttribute ();
-			TestStartAndEndTagWithAttribute ();
-			TestEmptyElementWithTwoAttributes ();
-			TestProcessingInstructionBeforeDocumentElement ();
-			TestCommentBeforeDocumentElement ();
-			TestPredefinedEntities ();
-			TestEntityReference ();
-			TestEntityReferenceInsideText ();
-			TestCharacterReferences ();
-			TestEntityReferenceInAttribute ();
-			TestPredefinedEntitiesInAttribute ();
-			TestCharacterReferencesInAttribute ();
-			TestCDATA ();
-			TestEmptyElementInNamespace ();
-			TestEmptyElementInDefaultNamespace ();
-			TestChildElementInNamespace ();
-			TestChildElementInDefaultNamespace ();
-			TestAttributeInNamespace ();
-			TestIsName ();
-			TestIsNameToken ();
-		}
-	}
-}
-
-namespace MonoTests.System.Xml
-{
-	public class RunXmlNamespaceManagerTests : XmlNamespaceManagerTests
-	{
-		protected override void RunTest ()
-		{
-			TestNewNamespaceManager ();
-			TestAddNamespace ();
-			TestPushScope ();
-			TestPopScope ();
-		}
-	}
-}
-
-namespace MonoTests.System.Xml
-{
-	public class RunXmlDocumentTests : XmlDocumentTests
-	{
-		protected override void RunTest ()
-		{
-			TestDocumentElement ();
-		}
-	}
-}
-
-namespace MonoTests
-{
-	public class RunAllTests
-	{
-		public static void AddAllTests (TestSuite suite)
-		{
-			suite.AddTest (new MonoTests.System.Xml.RunXmlTextReaderTests ());
-			suite.AddTest (new MonoTests.System.Xml.RunXmlNamespaceManagerTests ());
-			suite.AddTest (new MonoTests.System.Xml.RunXmlDocumentTests ());
-		}
-	}
-}
-
-class MainApp
-{
-	public static void Main()
-	{
-		Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
-
-		TestResult result = new TestResult ();
-		TestSuite suite = new TestSuite ();
-		MonoTests.RunAllTests.AddAllTests (suite);
-		suite.Run (result);
-		MonoTests.MyTestRunner.Print (result);
-	}
-}
-

+ 82 - 73
mcs/class/System.XML/Test/XPathNavigatorEvaluateTests.cs

@@ -1,10 +1,12 @@
 //
 // MonoTests.System.Xml.XPathNavigatorEvaluateTests
 //
-// Author:
+// Authors:
 //   Kral Ferch <[email protected]>
+//   Martin Willemoes Hansen <[email protected]>
 //
 // (C) 2002 Kral Ferch
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -15,11 +17,9 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XPathNavigatorEvaluateTests : TestCase
+	[TestFixture]
+	public class XPathNavigatorEvaluateTests
 	{
-		public XPathNavigatorEvaluateTests () : base ("MonoTests.System.Xml.XPathNavigatorEvaluateTests testsuite") {}
-		public XPathNavigatorEvaluateTests (string name) : base (name) {}
-
 		XmlDocument document;
 		XPathNavigator navigator;
 		XmlDocument document2;
@@ -29,7 +29,8 @@ namespace MonoTests.System.Xml
 		XPathExpression expression;
 		XPathNodeIterator iterator;
 
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 			document.LoadXml ("<foo><bar/><baz/><qux/><squonk/></foo>");
@@ -44,45 +45,48 @@ namespace MonoTests.System.Xml
 			navigator3 = document3.CreateNavigator ();
 		}
 
-		// Testing Core Function Library functions defined at: http://www.w3.org/TR/xpath#corelib
-		public void TestCoreFunctionNodeSetLast ()
+		// Testing Core Funcetion Library functions defined at: http://www.w3.org/TR/xpath#corelib
+		[Test]
+		public void CoreFunctionNodeSetLast ()
 		{
 			expression = navigator.Compile("last()");
 			iterator = navigator.Select("/foo");
-			AssertEquals ("0", navigator.Evaluate ("last()").ToString());
-			AssertEquals ("0", navigator.Evaluate (expression, null).ToString ());
-			AssertEquals ("1", navigator.Evaluate (expression, iterator).ToString ());
+			Assertion.AssertEquals ("0", navigator.Evaluate ("last()").ToString());
+			Assertion.AssertEquals ("0", navigator.Evaluate (expression, null).ToString ());
+			Assertion.AssertEquals ("1", navigator.Evaluate (expression, iterator).ToString ());
 			iterator = navigator.Select("/foo/*");
-			AssertEquals ("4", navigator.Evaluate (expression, iterator).ToString ());
+			Assertion.AssertEquals ("4", navigator.Evaluate (expression, iterator).ToString ());
 			
-			AssertEquals("3", navigator2.Evaluate ("string(//bar[last()]/@baz)"));
+			Assertion.AssertEquals("3", navigator2.Evaluate ("string(//bar[last()]/@baz)"));
 		}
 
-		public void TestCoreFunctionNodeSetPosition ()
+		[Test]
+		public void CoreFunctionNodeSetPosition ()
 		{
 			expression = navigator.Compile("position()");
 			iterator = navigator.Select("/foo");
-			AssertEquals ("0", navigator.Evaluate ("position()").ToString ());
-			AssertEquals ("0", navigator.Evaluate (expression, null).ToString ());
-			AssertEquals ("0", navigator.Evaluate (expression, iterator).ToString ());
+			Assertion.AssertEquals ("0", navigator.Evaluate ("position()").ToString ());
+			Assertion.AssertEquals ("0", navigator.Evaluate (expression, null).ToString ());
+			Assertion.AssertEquals ("0", navigator.Evaluate (expression, iterator).ToString ());
 			iterator = navigator.Select("/foo/*");
-			AssertEquals ("0", navigator.Evaluate (expression, iterator).ToString ());
+			Assertion.AssertEquals ("0", navigator.Evaluate (expression, iterator).ToString ());
 			iterator.MoveNext();
-			AssertEquals ("1", navigator.Evaluate (expression, iterator).ToString ());
+			Assertion.AssertEquals ("1", navigator.Evaluate (expression, iterator).ToString ());
 			iterator.MoveNext ();
-			AssertEquals ("2", navigator.Evaluate (expression, iterator).ToString ());
+			Assertion.AssertEquals ("2", navigator.Evaluate (expression, iterator).ToString ());
 			iterator.MoveNext ();
-			AssertEquals ("3", navigator.Evaluate (expression, iterator).ToString ());
+			Assertion.AssertEquals ("3", navigator.Evaluate (expression, iterator).ToString ());
 		}
 
-		public void TestCoreFunctionNodeSetCount ()
+		[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 ());
+			Assertion.AssertEquals ("5", navigator.Evaluate ("count(//*)").ToString ());
+			Assertion.AssertEquals ("1", navigator.Evaluate ("count(//foo)").ToString ());
+			Assertion.AssertEquals ("1", navigator.Evaluate ("count(/foo)").ToString ());
+			Assertion.AssertEquals ("1", navigator.Evaluate ("count(/foo/bar)").ToString ());
 
-			AssertEquals ("3", navigator2.Evaluate ("count(//bar)").ToString ());
+			Assertion.AssertEquals ("3", navigator2.Evaluate ("count(//bar)").ToString ());
 		}
 
 		public void saveTestCoreFunctionNodeSetID ()
@@ -96,28 +100,30 @@ 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 ());
+			Assertion.AssertEquals ("hello", navigator.Evaluate ("string(id('1')/@qux)").ToString ());
+			Assertion.AssertEquals ("world", navigator.Evaluate ("string(id('2')/@qux)").ToString ());
 		}
 
-		public void TestCoreFunctionLocalName ()
+		[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 ());
+			Assertion.AssertEquals ("", navigator.Evaluate ("local-name()").ToString ());
+			Assertion.AssertEquals ("", navigator.Evaluate ("local-name(/bogus)").ToString ());
+			Assertion.AssertEquals ("foo", navigator.Evaluate ("local-name(/foo)").ToString ());
+			Assertion.AssertEquals ("bar", navigator3.Evaluate ("local-name(/foo/*)").ToString ());
 		}
 
 		// TODO:  umm.  Unable to make this return a namespace-uri so far...
-		public void TestCoreFunctionNamespaceURI ()
+		[Test]
+		public void CoreFunctionNamespaceURI ()
 		{
 			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 ());
+			Assertion.AssertEquals ("", navigator.Evaluate ("namespace-uri()").ToString ());
+			Assertion.AssertEquals ("", navigator.Evaluate ("namespace-uri(/bogus)").ToString ());
+			//Assertion.AssertEquals("foo", navigator.Evaluate ("namespace-uri(/bar)").ToString ());
+			Assertion.AssertEquals ("", navigator2.Evaluate ("namespace-uri(//bar)").ToString ());
 		}
 
 		public void saveTestCoreFunctionString ()
@@ -125,88 +131,91 @@ 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 ());
+			Assertion.AssertEquals ("world", navigator.Evaluate ("string(/foo/*)").ToString ());
+			Assertion.AssertEquals ("NaN", navigator.Evaluate ("string(0 div 0)").ToString ());
 			
 			try {
 				navigator.Evaluate ("string(+0)");
-				Fail ("Expected an XPathException to be thrown.");
+				Assertion.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 ());
+			Assertion.AssertEquals ("0", navigator.Evaluate ("string(-0)").ToString ());			
+			Assertion.AssertEquals ("Infinity", navigator.Evaluate ("string(1 div 0)").ToString ());
+			Assertion.AssertEquals ("-Infinity", navigator.Evaluate ("string(-1 div 0)").ToString ());
+			Assertion.AssertEquals ("45", navigator.Evaluate ("string(45)").ToString ());
+			Assertion.AssertEquals ("-22", navigator.Evaluate ("string(-22)").ToString ());
+			Assertion.AssertEquals ("0.25", navigator.Evaluate ("string(.25)").ToString ());
+			Assertion.AssertEquals ("-0.25", navigator.Evaluate ("string(-.25)").ToString ());
+			Assertion.AssertEquals ("2", navigator.Evaluate ("string(2.0)").ToString ());
+			Assertion.AssertEquals ("2.01", navigator.Evaluate ("string(2.01)").ToString ());
+			Assertion.AssertEquals ("-3", navigator.Evaluate ("string(-3.0)").ToString ());
+			Assertion.AssertEquals ("3.45", navigator.Evaluate ("string(3.45)").ToString ());
 
 			// Wonder what this will look like under a different platform.
-			AssertEquals("0.33333333333333331", navigator.Evaluate ("string(1 div 3)").ToString ());
+			Assertion.AssertEquals("0.33333333333333331", navigator.Evaluate ("string(1 div 3)").ToString ());
 		}
 
-		public void TestCoreFunctionConcat ()
+		[Test]
+		public void CoreFunctionConcat ()
 		{
 			try {
 				navigator.Evaluate ("concat()");
-				Fail ("Expected an XPathException to be thrown.");
+				Assertion.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
 			try {
 				navigator.Evaluate ("concat('foo')");
-				Fail ("Expected an XPathException to be thrown.");
+				Assertion.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 ());
+			Assertion.AssertEquals ("foobar", navigator.Evaluate ("concat('foo', 'bar')").ToString ());
+			Assertion.AssertEquals ("foobarbaz", navigator.Evaluate ("concat('foo', 'bar', 'baz')").ToString ());
+			Assertion.AssertEquals ("foobarbazqux", navigator.Evaluate ("concat('foo', 'bar', 'baz', 'qux')").ToString ());
+			Assertion.AssertEquals ("foobarbazquxquux", navigator.Evaluate ("concat('foo', 'bar', 'baz', 'qux', 'quux')").ToString ());
 		}
 
-		public void TestCoreFunctionStartsWith ()
+		[Test]
+		public void CoreFunctionStartsWith ()
 		{
 			try {
 				navigator.Evaluate ("starts-with()");
-				Fail ("Expected an XPathException to be thrown.");
+				Assertion.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
 			try {
 				navigator.Evaluate ("starts-with('foo')");
-				Fail ("Expected an XPathException to be thrown.");
+				Assertion.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
 			try {
 				navigator.Evaluate ("starts-with('foo', 'bar', 'baz')");
-				Fail ("Expected an XPathException to be thrown.");
+				Assertion.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')"));
+			Assertion.Assert ((bool)navigator.Evaluate ("starts-with('foobar', 'foo')"));
+			Assertion.Assert (!(bool)navigator.Evaluate ("starts-with('foobar', 'bar')"));
 		}
 
-		public void TestCoreFunctionContains ()
+		[Test]
+		public void CoreFunctionContains ()
 		{
 			try {
 				navigator.Evaluate ("contains()");
-				Fail ("Expected an XPathException to be thrown.");
+				Assertion.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
 			try {
 				navigator.Evaluate ("contains('foo')");
-				Fail ("Expected an XPathException to be thrown.");
+				Assertion.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
 			try {
 				navigator.Evaluate ("contains('foobar', 'oob', 'baz')");
-				Fail ("Expected an XPathException to be thrown.");
+				Assertion.Fail ("Expected an XPathException to be thrown.");
 			} catch (XPathException) {}
 
-			Assert ((bool)navigator.Evaluate ("contains('foobar', 'oob')"));
-			Assert (!(bool)navigator.Evaluate ("contains('foobar', 'baz')"));
+			Assertion.Assert ((bool)navigator.Evaluate ("contains('foobar', 'oob')"));
+			Assertion.Assert (!(bool)navigator.Evaluate ("contains('foobar', 'baz')"));
 		}
 	}
 }

+ 37 - 27
mcs/class/System.XML/Test/XPathNavigatorMatchesTests.cs

@@ -1,10 +1,12 @@
 //
 // MonoTests.System.Xml.XPathNavigatorMatchesTests
 //
-// Author:
+// Authors:
 //   Jason Diamond <[email protected]>
+//   Martin Willemoes Hansen <[email protected]>
 //
 // (C) 2002 Jason Diamond
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -15,101 +17,109 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XPathNavigatorMatchesTests : TestCase
+	[TestFixture]
+	public class XPathNavigatorMatchesTests
 	{
-		public XPathNavigatorMatchesTests () : base ("MonoTests.System.Xml.XPathNavigatorMatchesTests testsuite") {}
-		public XPathNavigatorMatchesTests (string name) : base (name) {}
-
-		public void TestMatchRoot ()
+		[Test]
+		public void MatchRoot ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XPathNavigator navigator = document.CreateNavigator ();
 
-			Assert (navigator.Matches ("/"));
+			Assertion.Assert (navigator.Matches ("/"));
 		}
 
-		public void TestFalseMatchRoot ()
+		[Test]
+		public void FalseMatchRoot ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XPathNavigator navigator = document.CreateNavigator ();
 
-			Assert (!navigator.Matches ("foo"));
+			Assertion.Assert (!navigator.Matches ("foo"));
 		}
 
-		public void TestMatchDocumentElement ()
+		[Test]
+		public void MatchDocumentElement ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XPathNavigator navigator = document.DocumentElement.CreateNavigator ();
 
-			Assert (navigator.Matches ("foo"));
+			Assertion.Assert (navigator.Matches ("foo"));
 		}
 
-		public void TestMatchAbsoluteDocumentElement ()
+		[Test]
+		public void MatchAbsoluteDocumentElement ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XPathNavigator navigator = document.DocumentElement.CreateNavigator ();
 
-			Assert (navigator.Matches ("/foo"));
+			Assertion.Assert (navigator.Matches ("/foo"));
 		}
 
-		public void TestMatchDocumentElementChild ()
+		[Test]
+		public void MatchDocumentElementChild ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /></foo>");
 			XPathNavigator navigator = document.DocumentElement.FirstChild.CreateNavigator ();
 
-			Assert (navigator.Matches ("bar"));
-			Assert (navigator.Matches ("foo/bar"));
+			Assertion.Assert (navigator.Matches ("bar"));
+			Assertion.Assert (navigator.Matches ("foo/bar"));
 		}
 
-		public void TestMatchAttribute ()
+		[Test]
+		public void MatchAttribute ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo bar='baz' />");
 			XPathNavigator navigator = document.DocumentElement.Attributes[0].CreateNavigator ();
 
-			Assert (navigator.Matches ("@bar"));
-			Assert (navigator.Matches ("foo/@bar"));
+			Assertion.Assert (navigator.Matches ("@bar"));
+			Assertion.Assert (navigator.Matches ("foo/@bar"));
 		}
 
-		public void TestSlashSlash ()
+		[Test]
+		public void SlashSlash ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar><baz/></bar></foo>");
 			XPathNavigator navigator = document.DocumentElement.FirstChild.FirstChild.CreateNavigator ();
 
-			Assert (navigator.Matches ("foo//baz"));
+			Assertion.Assert (navigator.Matches ("foo//baz"));
 		}
 
-		public void TestAbsoluteSlashSlash ()
+		[Test]
+		public void AbsoluteSlashSlash ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar><baz/></bar></foo>");
 			XPathNavigator navigator = document.DocumentElement.FirstChild.FirstChild.CreateNavigator ();
 
-			Assert (navigator.Matches ("//baz"));
+			Assertion.Assert (navigator.Matches ("//baz"));
 		}
 
-		public void TestMatchDocumentElementWithPredicate ()
+		[Test]
+		public void MatchDocumentElementWithPredicate ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /></foo>");
 			XPathNavigator navigator = document.DocumentElement.CreateNavigator ();
 
-			Assert (navigator.Matches ("foo[bar]"));
+			Assertion.Assert (navigator.Matches ("foo[bar]"));
 		}
 
-		public void TestFalseMatchDocumentElementWithPredicate ()
+		[Test]
+		public void FalseMatchDocumentElementWithPredicate ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /></foo>");
 			XPathNavigator navigator = document.DocumentElement.CreateNavigator ();
 
-			Assert (!navigator.Matches ("foo[baz]"));
+			Assertion.Assert (!navigator.Matches ("foo[baz]"));
 		}
 	}
 }

+ 97 - 89
mcs/class/System.XML/Test/XPathNavigatorTests.cs

@@ -1,10 +1,12 @@
 //
 // MonoTests.System.Xml.XPathNavigatorTests
 //
-// Author:
+// Authors:
 //   Jason Diamond <[email protected]>
+//   Martin Willemoes Hansen <[email protected]>
 //
 // (C) 2002 Jason Diamond
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -15,102 +17,106 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XPathNavigatorTests : TestCase
+	[TestFixture]
+	public class XPathNavigatorTests
 	{
-		public XPathNavigatorTests () : base ("MonoTests.System.Xml.XPathNavigatorTests testsuite") {}
-		public XPathNavigatorTests (string name) : base (name) {}
-
-		public void TestCreateNavigator ()
+		[Test]
+		public void CreateNavigator ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo />");
 			XPathNavigator navigator = document.CreateNavigator ();
-			AssertNotNull (navigator);
+			Assertion.AssertNotNull (navigator);
 		}
 
-		public void TestPropertiesOnDocument ()
+		[Test]
+		public void PropertiesOnDocument ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo:bar xmlns:foo='#foo' />");
 			XPathNavigator 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);
+			Assertion.AssertEquals (XPathNodeType.Root, navigator.NodeType);
+			Assertion.AssertEquals (String.Empty, navigator.Name);
+			Assertion.AssertEquals (String.Empty, navigator.LocalName);
+			Assertion.AssertEquals (String.Empty, navigator.NamespaceURI);
+			Assertion.AssertEquals (String.Empty, navigator.Prefix);
+			Assertion.Assert (!navigator.HasAttributes);
+			Assertion.Assert (navigator.HasChildren);
+			Assertion.Assert (!navigator.IsEmptyElement);
 		}
 
-		public void TestPropertiesOnElement ()
+		[Test]
+		public void PropertiesOnElement ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo:bar xmlns:foo='#foo' />");
 			XPathNavigator 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);
+			Assertion.AssertEquals (XPathNodeType.Element, navigator.NodeType);
+			Assertion.AssertEquals ("foo:bar", navigator.Name);
+			Assertion.AssertEquals ("bar", navigator.LocalName);
+			Assertion.AssertEquals ("#foo", navigator.NamespaceURI);
+			Assertion.AssertEquals ("foo", navigator.Prefix);
+			Assertion.Assert (!navigator.HasAttributes);
+			Assertion.Assert (!navigator.HasChildren);
+			Assertion.Assert (navigator.IsEmptyElement);
 		}
 
-		public void TestPropertiesOnAttribute ()
+		[Test]
+		public void PropertiesOnAttribute ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo bar:baz='quux' xmlns:bar='#bar' />");
 			XPathNavigator 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);
+			Assertion.AssertEquals (XPathNodeType.Attribute, navigator.NodeType);
+			Assertion.AssertEquals ("bar:baz", navigator.Name);
+			Assertion.AssertEquals ("baz", navigator.LocalName);
+			Assertion.AssertEquals ("#bar", navigator.NamespaceURI);
+			Assertion.AssertEquals ("bar", navigator.Prefix);
+			Assertion.Assert (!navigator.HasAttributes);
+			Assertion.Assert (!navigator.HasChildren);
+			Assertion.Assert (!navigator.IsEmptyElement);
 		}
 
-		public void TestNavigation ()
+		[Test]
+		public void Navigation ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar /><baz /></foo>");
 			XPathNavigator 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);
+			Assertion.AssertEquals ("foo", navigator.Name);
+			Assertion.Assert (navigator.MoveToFirstChild ());
+			Assertion.AssertEquals ("bar", navigator.Name);
+			Assertion.Assert (navigator.MoveToNext ());
+			Assertion.AssertEquals ("baz", navigator.Name);
+			Assertion.Assert (!navigator.MoveToNext ());
+			Assertion.AssertEquals ("baz", navigator.Name);
+			Assertion.Assert (navigator.MoveToPrevious ());
+			Assertion.AssertEquals ("bar", navigator.Name);
+			Assertion.Assert (!navigator.MoveToPrevious ());
+			Assertion.Assert (navigator.MoveToParent ());
+			Assertion.AssertEquals ("foo", navigator.Name);
 			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);
+			Assertion.AssertEquals (XPathNodeType.Root, navigator.NodeType);
+			Assertion.Assert (!navigator.MoveToParent ());
+			Assertion.AssertEquals (XPathNodeType.Root, navigator.NodeType);
+			Assertion.Assert (navigator.MoveToFirstChild ());
+			Assertion.AssertEquals ("foo", navigator.Name);
+			Assertion.Assert (navigator.MoveToFirst ());
+			Assertion.AssertEquals ("foo", navigator.Name);
+			Assertion.Assert (navigator.MoveToFirstChild ());
+			Assertion.AssertEquals ("bar", navigator.Name);
+			Assertion.Assert (navigator.MoveToNext ());
+			Assertion.AssertEquals ("baz", navigator.Name);
+			Assertion.Assert (navigator.MoveToFirst ());
+			Assertion.AssertEquals ("bar", navigator.Name);
 		}
 
-		public void TestMoveToAndIsSamePosition ()
+		[Test]
+		public void MoveToAndIsSamePosition ()
 		{
 			XmlDocument document1 = new XmlDocument ();
 			document1.LoadXml ("<foo><bar /></foo>");
@@ -121,52 +127,54 @@ 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);
+			Assertion.AssertEquals ("foo", navigator1a.Name);
+			Assertion.Assert (navigator1a.MoveToFirstChild ());
+			Assertion.AssertEquals ("bar", navigator1a.Name);
 
-			Assert (!navigator1b.IsSamePosition (navigator1a));
-			AssertEquals ("foo", navigator1b.Name);
-			Assert (navigator1b.MoveTo (navigator1a));
-			Assert (navigator1b.IsSamePosition (navigator1a));
-			AssertEquals ("bar", navigator1b.Name);
+			Assertion.Assert (!navigator1b.IsSamePosition (navigator1a));
+			Assertion.AssertEquals ("foo", navigator1b.Name);
+			Assertion.Assert (navigator1b.MoveTo (navigator1a));
+			Assertion.Assert (navigator1b.IsSamePosition (navigator1a));
+			Assertion.AssertEquals ("bar", navigator1b.Name);
 
-			Assert (!navigator2.IsSamePosition (navigator1a));
-			AssertEquals ("foo", navigator2.Name);
-			Assert (!navigator2.MoveTo (navigator1a));
-			AssertEquals ("foo", navigator2.Name);
+			Assertion.Assert (!navigator2.IsSamePosition (navigator1a));
+			Assertion.AssertEquals ("foo", navigator2.Name);
+			Assertion.Assert (!navigator2.MoveTo (navigator1a));
+			Assertion.AssertEquals ("foo", navigator2.Name);
 		}
 
-		public void TestAttributeNavigation ()
+		[Test]
+		public void AttributeNavigation ()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo bar='baz' quux='quuux' />");
 			XPathNavigator 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);
+			Assertion.AssertEquals (XPathNodeType.Element, navigator.NodeType);
+			Assertion.AssertEquals ("foo", navigator.Name);
+			Assertion.Assert (navigator.MoveToFirstAttribute ());
+			Assertion.AssertEquals (XPathNodeType.Attribute, navigator.NodeType);
+			Assertion.AssertEquals ("bar", navigator.Name);
+			Assertion.AssertEquals ("baz", navigator.Value);
+			Assertion.Assert (navigator.MoveToNextAttribute ());
+			Assertion.AssertEquals (XPathNodeType.Attribute, navigator.NodeType);
+			Assertion.AssertEquals ("quux", navigator.Name);
+			Assertion.AssertEquals ("quuux", navigator.Value);
 		}
 
-		public void TestElementAndRootValues()
+		[Test]
+		public void ElementAndRootValues()
 		{
 			XmlDocument document = new XmlDocument ();
 			document.LoadXml ("<foo><bar>baz</bar><quux>quuux</quux></foo>");
 			XPathNavigator navigator = document.DocumentElement.CreateNavigator ();
 
-			AssertEquals (XPathNodeType.Element, navigator.NodeType);
-			AssertEquals ("foo", navigator.Name);
-			//AssertEquals ("bazquuux", navigator.Value);
+			Assertion.AssertEquals (XPathNodeType.Element, navigator.NodeType);
+			Assertion.AssertEquals ("foo", navigator.Name);
+			//Assertion.AssertEquals ("bazquuux", navigator.Value);
 
 			navigator.MoveToRoot ();
-			//AssertEquals ("bazquuux", navigator.Value);
+			//Assertion.AssertEquals ("bazquuux", navigator.Value);
 		}
 	}
 }

+ 46 - 38
mcs/class/System.XML/Test/XmlAttributeCollectionTests.cs

@@ -1,8 +1,10 @@
 // XmlAttributeCollectionTests.cs : Tests for the XmlAttributeCollection class
 //
 // Author: Matt Hunter <[email protected]>
+// Author: Martin Willemoes Hansen <[email protected]>
 //
-// <c> 2002 Matt Hunter
+// (C) 2002 Matt Hunter
+// (C) 2003 Martin Willemoes Hansen
 
 using System;
 using System.Xml;
@@ -14,18 +16,19 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlAttributeCollectionTests : TestCase
+	[TestFixture]
+	public class XmlAttributeCollectionTests
 	{
-		public XmlAttributeCollectionTests() : base("MonoTests.System.Xml.XmlAttributeCollectionTests testsuite") { }
-		public XmlAttributeCollectionTests(string name) : base(name) { }
-
 		private XmlDocument document;
 
-		protected override void SetUp()
+		[SetUp]
+		public void GetReady()
 		{
 			document = new XmlDocument ();
 		}
-		public void TestRemoveAll ()
+
+		[Test]
+		public void RemoveAll ()
 		{
 			StringBuilder xml = new StringBuilder ();
 			xml.Append ("<?xml version=\"1.0\" ?><library><book type=\"non-fiction\" price=\"34.95\"> ");
@@ -40,10 +43,11 @@ namespace MonoTests.System.Xml
 			XmlElement xmlElement = xmlNode as XmlElement;
 			XmlAttributeCollection attributes = xmlElement.Attributes;
 			attributes.RemoveAll ();
-			AssertEquals ("not all attributes removed.", false, xmlElement.HasAttribute ("type"));
+			Assertion.AssertEquals ("not all attributes removed.", false, xmlElement.HasAttribute ("type"));
 		}
 
-		public void TestAppend () 
+		[Test]
+		public void Append () 
 		{
 			XmlDocument xmlDoc = new XmlDocument ();
 			XmlElement xmlEl = xmlDoc.CreateElement ("TestElement");
@@ -52,27 +56,29 @@ namespace MonoTests.System.Xml
 			XmlAttribute xmlAttribute3 = xmlNode as XmlAttribute;
 			XmlAttributeCollection attributeCol = xmlEl.Attributes;
 			xmlAttribute3 = attributeCol.Append (xmlAttribute3);
-			AssertEquals ("attribute name not properly created.", true, xmlAttribute3.Name.Equals ("attr3"));
-			AssertEquals ("attribute namespace not properly created.", true, xmlAttribute3.NamespaceURI.Equals ("namespace1"));
+			Assertion.AssertEquals ("attribute name not properly created.", true, xmlAttribute3.Name.Equals ("attr3"));
+			Assertion.AssertEquals ("attribute namespace not properly created.", true, xmlAttribute3.NamespaceURI.Equals ("namespace1"));
 		}
 
-		public void TestCopyTo () 
+		[Test]
+		public void CopyTo () 
 		{
 			XmlDocument xmlDoc = new XmlDocument ();
 			xmlDoc.LoadXml("<root a1='garnet' a2='amethyst' a3='Bloodstone' a4='diamond' a5='emerald' a6='pearl' a7='ruby' a8='sapphire' a9='moonstone' a10='opal' a11='topaz' a12='turquoize' />");
 			XmlAttributeCollection col = xmlDoc.DocumentElement.Attributes;
 			XmlAttribute[] array = new XmlAttribute[24];
 			col.CopyTo(array, 0);
-			AssertEquals("garnet", array[0].Value);
-			AssertEquals("moonstone", array[8].Value);
-			AssertEquals("turquoize", array[11].Value);
+			Assertion.AssertEquals("garnet", array[0].Value);
+			Assertion.AssertEquals("moonstone", array[8].Value);
+			Assertion.AssertEquals("turquoize", array[11].Value);
 			col.CopyTo(array, 12);
-			AssertEquals("garnet", array[12].Value);
-			AssertEquals("moonstone", array[20].Value);
-			AssertEquals("turquoize", array[23].Value);
+			Assertion.AssertEquals("garnet", array[12].Value);
+			Assertion.AssertEquals("moonstone", array[20].Value);
+			Assertion.AssertEquals("turquoize", array[23].Value);
 		}
 
-		public void TestSetNamedItem ()
+		[Test]
+		public void SetNamedItem ()
 		{
 			XmlDocument xmlDoc = new XmlDocument ();
 			xmlDoc.LoadXml("<root />");
@@ -82,17 +88,18 @@ namespace MonoTests.System.Xml
 			XmlAttribute attr = xmlDoc.CreateAttribute("b3");
 			attr.Value = "bloodstone";
 			col.SetNamedItem(attr);
-			AssertEquals("SetNamedItem.Normal", "bloodstone", el.GetAttribute("b3"));
+			Assertion.AssertEquals("SetNamedItem.Normal", "bloodstone", el.GetAttribute("b3"));
 
 			attr = xmlDoc.CreateAttribute("b3");
 			attr.Value = "aquamaline";
 			col.SetNamedItem(attr);
-			AssertEquals("SetNamedItem.Override", "aquamaline", el.GetAttribute("b3"));
-			AssertEquals("SetNamedItem.Override.Count.1", 1, el.Attributes.Count);
-			AssertEquals("SetNamedItem.Override.Count.2", 1, col.Count);
+			Assertion.AssertEquals("SetNamedItem.Override", "aquamaline", el.GetAttribute("b3"));
+			Assertion.AssertEquals("SetNamedItem.Override.Count.1", 1, el.Attributes.Count);
+			Assertion.AssertEquals("SetNamedItem.Override.Count.2", 1, col.Count);
 		}
 
-		public void TestInsertBeforeAfterPrepend () 
+		[Test]
+		public void InsertBeforeAfterPrepend () 
 		{
 			XmlDocument xmlDoc = new XmlDocument ();
 			xmlDoc.LoadXml("<root b2='amethyst' />");
@@ -101,34 +108,35 @@ namespace MonoTests.System.Xml
 			XmlAttribute attr = xmlDoc.CreateAttribute("b1");
 			attr.Value = "garnet";
 			col.InsertAfter(attr, null);
-			AssertEquals("InsertAfterNull", "garnet", el.GetAttributeNode("b1").Value);
-			AssertEquals("InsertAfterNull.Pos", el.GetAttribute("b1"), col[0].Value);
+			Assertion.AssertEquals("InsertAfterNull", "garnet", el.GetAttributeNode("b1").Value);
+			Assertion.AssertEquals("InsertAfterNull.Pos", el.GetAttribute("b1"), col[0].Value);
 
 			attr = xmlDoc.CreateAttribute("b3");
 			attr.Value = "bloodstone";
 			col.InsertAfter(attr, el.GetAttributeNode("b2"));
-			AssertEquals("InsertAfterAttr", "bloodstone", el.GetAttributeNode("b3").Value);
-			AssertEquals("InsertAfterAttr.Pos", el.GetAttribute("b3"), col[2].Value);
+			Assertion.AssertEquals("InsertAfterAttr", "bloodstone", el.GetAttributeNode("b3").Value);
+			Assertion.AssertEquals("InsertAfterAttr.Pos", el.GetAttribute("b3"), col[2].Value);
 
 			attr = xmlDoc.CreateAttribute("b4");
 			attr.Value = "diamond";
 			col.InsertBefore(attr, null);
-			AssertEquals("InsertBeforeNull", "diamond", el.GetAttributeNode("b4").Value);
-			AssertEquals("InsertBeforeNull.Pos", el.GetAttribute("b4"), col[3].Value);
+			Assertion.AssertEquals("InsertBeforeNull", "diamond", el.GetAttributeNode("b4").Value);
+			Assertion.AssertEquals("InsertBeforeNull.Pos", el.GetAttribute("b4"), col[3].Value);
 
 			attr = xmlDoc.CreateAttribute("warning");
 			attr.Value = "mixed modern and traditional;-)";
 			col.InsertBefore(attr, el.GetAttributeNode("b1"));
-			AssertEquals("InsertBeforeAttr", "mixed modern and traditional;-)", el.GetAttributeNode("warning").Value);
-			AssertEquals("InsertBeforeAttr.Pos", el.GetAttributeNode("warning").Value, col[0].Value);
+			Assertion.AssertEquals("InsertBeforeAttr", "mixed modern and traditional;-)", el.GetAttributeNode("warning").Value);
+			Assertion.AssertEquals("InsertBeforeAttr.Pos", el.GetAttributeNode("warning").Value, col[0].Value);
 
 			attr = xmlDoc.CreateAttribute("about");
 			attr.Value = "lists of birthstone.";
 			col.Prepend(attr);
-			AssertEquals("Prepend", "lists of birthstone.", col[0].Value);
+			Assertion.AssertEquals("Prepend", "lists of birthstone.", col[0].Value);
 		}
 
-		public void TestRemove ()
+		[Test]
+		public void Remove ()
 		{
 			XmlDocument xmlDoc = new XmlDocument ();
 			xmlDoc.LoadXml("<root a1='garnet' a2='amethyst' a3='bloodstone' a4='diamond' a5='emerald' a6='pearl' a7='ruby' a8='sapphire' a9='moonstone' a10='opal' a11='topaz' a12='turquoize' />");
@@ -137,13 +145,13 @@ namespace MonoTests.System.Xml
 
 			// Remove
 			XmlAttribute attr = col.Remove(el.GetAttributeNode("a12"));
-			AssertEquals("Remove", 11, col.Count);
-			AssertEquals("Remove.Removed", "a12", attr.Name);
+			Assertion.AssertEquals("Remove", 11, col.Count);
+			Assertion.AssertEquals("Remove.Removed", "a12", attr.Name);
 
 			// RemoveAt
 			attr = col.RemoveAt(5);
-			AssertEquals("RemoveAt", null, el.GetAttributeNode("a6"));
-			AssertEquals("Remove.Removed", "pearl", attr.Value);
+			Assertion.AssertEquals("RemoveAt", null, el.GetAttributeNode("a6"));
+			Assertion.AssertEquals("Remove.Removed", "pearl", attr.Value);
 		}
 	}
 }

+ 54 - 42
mcs/class/System.XML/Test/XmlAttributeTests.cs

@@ -1,8 +1,10 @@
 // XmlAttributeTests.cs : Tests for the XmlAttribute class
 //
 // Author: Mike Kestner <[email protected]>
+// Author: Martin Willemoes Hansen <[email protected]>
 //
-// <c> 2002 Mike Kestner
+// (C) 2002 Mike Kestner
+// (C) 2003 Martin Willemoes Hansen
 
 using System;
 using System.Xml;
@@ -11,104 +13,114 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlAttributeTests : TestCase
+	[TestFixture]
+	public class XmlAttributeTests
 	{
-		public XmlAttributeTests () : base("MonoTests.System.Xml.XmlAttributeTests testsuite") { }
-		public XmlAttributeTests (string name) : base(name) { }
-
 		XmlDocument doc;
 		XmlAttribute attr;
 
-		protected override void SetUp()
+		[SetUp]
+		public void GetReady()
 		{
 			doc = new XmlDocument ();
 			attr = doc.CreateAttribute ("attr1");
 			attr.Value = "val1";
 		}
 
-		public void TestAttributes ()
+		[Test]
+		public void Attributes ()
 		{
-			AssertNull (attr.Attributes);
+			Assertion.AssertNull (attr.Attributes);
 		}
 
-		public void TestAttributeInnerAndOuterXml ()
+		[Test]
+		public void AttributeInnerAndOuterXml ()
 		{
 			attr = doc.CreateAttribute ("foo", "bar", "http://abc.def");
 			attr.Value = "baz";
-			AssertEquals ("baz", attr.InnerXml);
-			AssertEquals ("foo:bar=\"baz\"", attr.OuterXml);
+			Assertion.AssertEquals ("baz", attr.InnerXml);
+			Assertion.AssertEquals ("foo:bar=\"baz\"", attr.OuterXml);
 		}
 
-		public void TestAttributeWithNoValue ()
+		[Test]
+		public void AttributeWithNoValue ()
 		{
 			XmlAttribute attribute = doc.CreateAttribute ("name");
-			AssertEquals (String.Empty, attribute.Value);
-			Assert (!attribute.HasChildNodes);
-			AssertNull (attribute.FirstChild);
-			AssertNull (attribute.LastChild);
-			AssertEquals (0, attribute.ChildNodes.Count);
+			Assertion.AssertEquals (String.Empty, attribute.Value);
+			Assertion.Assert (!attribute.HasChildNodes);
+			Assertion.AssertNull (attribute.FirstChild);
+			Assertion.AssertNull (attribute.LastChild);
+			Assertion.AssertEquals (0, attribute.ChildNodes.Count);
 		}
 
-		public void TestAttributeWithValue ()
+		[Test]
+		public void AttributeWithValue ()
 		{
 			XmlAttribute attribute = doc.CreateAttribute ("name");
 			attribute.Value = "value";
-			AssertEquals ("value", attribute.Value);
-			Assert (attribute.HasChildNodes);
-			AssertNotNull (attribute.FirstChild);
-			AssertNotNull (attribute.LastChild);
-			AssertEquals (1, attribute.ChildNodes.Count);
-			AssertEquals (XmlNodeType.Text, attribute.ChildNodes [0].NodeType);
-			AssertEquals ("value", attribute.ChildNodes [0].Value);
+			Assertion.AssertEquals ("value", attribute.Value);
+			Assertion.Assert (attribute.HasChildNodes);
+			Assertion.AssertNotNull (attribute.FirstChild);
+			Assertion.AssertNotNull (attribute.LastChild);
+			Assertion.AssertEquals (1, attribute.ChildNodes.Count);
+			Assertion.AssertEquals (XmlNodeType.Text, attribute.ChildNodes [0].NodeType);
+			Assertion.AssertEquals ("value", attribute.ChildNodes [0].Value);
 		}
 
-		public void TestHasChildNodes ()
+		[Test]
+		public void HasChildNodes ()
 		{
-			Assert (attr.HasChildNodes);
+			Assertion.Assert (attr.HasChildNodes);
 		}
 
-		public void TestName ()
+		[Test]
+		public void Name ()
 		{
-			AssertEquals ("attr1", attr.Name);
+			Assertion.AssertEquals ("attr1", attr.Name);
 		}
 
-		public void TestNodeType ()
+		[Test]
+		public void NodeType ()
 		{
-			AssertEquals (XmlNodeType.Attribute, attr.NodeType);
+			Assertion.AssertEquals (XmlNodeType.Attribute, attr.NodeType);
 		}
 
-		public void TestOwnerDocument ()
+		[Test]
+		public void OwnerDocument ()
 		{
-			AssertSame (doc, attr.OwnerDocument);
+			Assertion.AssertSame (doc, attr.OwnerDocument);
 		}
 
-		public void TestParentNode ()
+		[Test]
+		public void ParentNode ()
 		{
-			AssertNull ("Attr parents not allowed", attr.ParentNode);
+			Assertion.AssertNull ("Attr parents not allowed", attr.ParentNode);
 		}
 
-		public void TestValue ()
+		[Test]
+		public void Value ()
 		{
-			AssertEquals ("val1", attr.Value);
+			Assertion.AssertEquals ("val1", attr.Value);
 		}
 
-		public void TestSetInnerTextAndXml ()
+		[Test]
+		public void SetInnerTextAndXml ()
 		{
 			string original = doc.OuterXml;
 			doc.LoadXml ("<root name='value' />");
 			XmlNodeChangedEventHandler eh = new XmlNodeChangedEventHandler (OnSetInnerText);
 			try {
 				doc.DocumentElement.Attributes ["name"].InnerText = "a&b";
-				AssertEquals ("setInnerText", "a&b", doc.DocumentElement.Attributes ["name"].Value);
+				Assertion.AssertEquals ("setInnerText", "a&b", doc.DocumentElement.Attributes ["name"].Value);
 				doc.DocumentElement.Attributes ["name"].InnerXml = "a&amp;b";
-				AssertEquals ("setInnerXml", "a&b", doc.DocumentElement.Attributes ["name"].Value);
+				Assertion.AssertEquals ("setInnerXml", "a&b", doc.DocumentElement.Attributes ["name"].Value);
 
 				doc.NodeChanged += eh;
 				doc.DocumentElement.Attributes ["name"].InnerText = "fire";
 				// If you failed to pass it, then the reason may be loop of event.
-				AssertEquals ("setInnerText.Event", "event was fired", doc.DocumentElement.GetAttribute ("appended"));
+				Assertion.AssertEquals ("setInnerText.Event", "event was fired", doc.DocumentElement.GetAttribute ("appended"));
 			} catch(Exception ex) {
-				Fail(ex.Message);
+				Assertion.Fail(ex.Message);
 			} finally {
 				doc.LoadXml (original);
 				doc.NodeChanged -= eh;

+ 34 - 34
mcs/class/System.XML/Test/XmlCDataSectionTests.cs

@@ -1,10 +1,12 @@
 //
 // System.Xml.XmlCDataSectionTests.cs
 //
-// Author:
+// Authors:
 //	Duncan Mak  ([email protected])
+//      Martin Willemoes Hansen ([email protected])
 //
 // (C) Ximian, Inc.
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -14,7 +16,8 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlCDataSectionTests : TestCase
+	[TestFixture]
+	public class XmlCDataSectionTests
 	{
 		XmlDocument document;
 		XmlCDataSection section;
@@ -22,77 +25,74 @@ namespace MonoTests.System.Xml
 		XmlNode deep;
 		XmlNode shallow;
 
-		public XmlCDataSectionTests ()
-			: base ("MonoTests.System.Xml.XmlCDataSectionTests testsuite")
-		{
-		}
-
-		public XmlCDataSectionTests (string name)
-			: base (name)
-		{
-		}
-
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 			document.LoadXml ("<root><foo></foo></root>");
 			section = document.CreateCDataSection ("CDataSection");
 		}
 
-		internal void TestXmlNodeBaseProperties (XmlNode original, XmlNode cloned)
+		internal void XmlNodeBaseProperties (XmlNode original, XmlNode cloned)
 		{
-			// AssertEquals (original.nodetype + " was incorrectly cloned.",
+			// Assertion.AssertEquals (original.nodetype + " was incorrectly cloned.",
 			// 		 original.baseuri, cloned.baseuri);			
-			AssertNull (cloned.ParentNode);
-                        Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
+			Assertion.AssertNull (cloned.ParentNode);
+                        Assertion.Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
 		}
 	       
-		public void TestXmlCDataSectionInnerAndOuterXml ()
+		[Test]
+		public void XmlCDataSectionInnerAndOuterXml ()
 		{
 			section = document.CreateCDataSection ("foo");
-			AssertEquals (String.Empty, section.InnerXml);
-			AssertEquals ("<![CDATA[foo]]>", section.OuterXml);
+			Assertion.AssertEquals (String.Empty, section.InnerXml);
+			Assertion.AssertEquals ("<![CDATA[foo]]>", section.OuterXml);
 		}
 
-		public void TestXmlCDataSectionName ()
+		[Test]
+		public void XmlCDataSectionName ()
 		{
-			AssertEquals (section.NodeType + " Name property broken",
+			Assertion.AssertEquals (section.NodeType + " Name property broken",
 				      section.Name, "#cdata-section");
 		}
 
-		public void TestXmlCDataSectionLocalName ()
+		[Test]
+		public void XmlCDataSectionLocalName ()
 		{
-			AssertEquals (section.NodeType + " LocalName property broken",
+			Assertion.AssertEquals (section.NodeType + " LocalName property broken",
 				      section.LocalName, "#cdata-section");
 		}
 
-		public void TestXmlCDataSectionNodeType ()
+		[Test]
+		public void XmlCDataSectionNodeType ()
 		{
-			AssertEquals ("XmlCDataSection NodeType property broken",
+			Assertion.AssertEquals ("XmlCDataSection NodeType property broken",
 				      section.NodeType.ToString (), "CDATA");
 		}
 
-		public void TestXmlCDataSectionIsReadOnly ()
+		[Test]
+		public void XmlCDataSectionIsReadOnly ()
 		{
-			AssertEquals ("XmlCDataSection IsReadOnly property broken",
+			Assertion.AssertEquals ("XmlCDataSection IsReadOnly property broken",
 				      section.IsReadOnly, false);
 		}
 
-		public void TestXmlCDataSectionCloneNode ()
+		[Test]
+		public void XmlCDataSectionCloneNode ()
 		{
 			original = section;
 
 			shallow = section.CloneNode (false); // shallow
-			TestXmlNodeBaseProperties (original, shallow);
-			AssertEquals ("Value incorrectly cloned",
+			XmlNodeBaseProperties (original, shallow);
+			Assertion.AssertEquals ("Value incorrectly cloned",
 				      original.Value, shallow.Value);
 			
 			deep = section.CloneNode (true); // deep
-			TestXmlNodeBaseProperties (original, deep);
-			AssertEquals ("Value incorrectly cloned",
+			XmlNodeBaseProperties (original, deep);
+			Assertion.AssertEquals ("Value incorrectly cloned",
 				       original.Value, deep.Value);
 
-                        AssertEquals ("deep cloning differs from shallow cloning",
+                        Assertion.AssertEquals ("deep cloning differs from shallow cloning",
 				      deep.OuterXml, shallow.OuterXml);
 		}
 	}

+ 42 - 38
mcs/class/System.XML/Test/XmlCharacterDataTests.cs

@@ -1,10 +1,11 @@
 //
 // System.Xml.XmlTextWriterTests
 //
-// Author:
-//   Kral Ferch <[email protected]>
+// Author: Kral Ferch <[email protected]>
+// Author: Martin Willemoes Hansen <[email protected]>
 //
 // (C) 2002 Kral Ferch
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -14,17 +15,16 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlCharacterDataTests : TestCase
+	[TestFixture]
+	public class XmlCharacterDataTests
 	{
-		public XmlCharacterDataTests () : base ("MonoTests.System.Xml.XmlCharacterDataTests testsuite") {}
-		public XmlCharacterDataTests (string name) : base (name) {}
-
 		XmlDocument document;
 		XmlComment comment;
 		bool changed;
 		bool changing;
 
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 			document.NodeChanged += new XmlNodeChangedEventHandler (this.EventNodeChanged);
@@ -42,74 +42,77 @@ namespace MonoTests.System.Xml
 			changing = true;
 		}
 
-		public void TestAppendData ()
+		[Test]
+		public void AppendData ()
 		{
 			changed = false;
 			changing = false;
 			comment.AppendData ("bar");
-			Assert (changed);
-			Assert (changing);
-			AssertEquals ("foobar", comment.Data);
+			Assertion.Assert (changed);
+			Assertion.Assert (changing);
+			Assertion.AssertEquals ("foobar", comment.Data);
 
 			comment.Value = "foo";
 			comment.AppendData (null);
-			AssertEquals ("foo", comment.Data);
+			Assertion.AssertEquals ("foo", comment.Data);
 		}
 
-		public void TestDeleteData ()
+		[Test]
+		public void DeleteData ()
 		{
 			comment.Value = "bar";
 			changed = false;
 			changing = false;
 			comment.DeleteData (1, 1);
-			Assert (changed);
-			Assert (changing);
-			AssertEquals ("br", comment.Data);
+			Assertion.Assert (changed);
+			Assertion.Assert (changing);
+			Assertion.AssertEquals ("br", comment.Data);
 
 			try 
 			{
 				comment.Value = "foo";
 				comment.DeleteData(-1, 1);
-				Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
+				Assertion.Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
 			} 
 			catch (ArgumentOutOfRangeException) {}
 
 			comment.Value = "foo";
 			comment.DeleteData(1, 5);
-			AssertEquals("f", comment.Data);
+			Assertion.AssertEquals("f", comment.Data);
 
 			comment.Value = "foo";
 			comment.DeleteData(3, 10);
-			AssertEquals("foo", comment.Data);
+			Assertion.AssertEquals("foo", comment.Data);
 		}
 
-		public void TestInsertData ()
+		[Test]
+		public void InsertData ()
 		{
 			comment.Value = "foobaz";
 			changed = false;
 			changing = false;
 			comment.InsertData (3, "bar");
-			Assert (changed);
-			Assert (changing);
-			AssertEquals ("foobarbaz", comment.Data);
+			Assertion.Assert (changed);
+			Assertion.Assert (changing);
+			Assertion.AssertEquals ("foobarbaz", comment.Data);
 
 			try 
 			{
 				comment.Value = "foo";
 				comment.InsertData (-1, "bar");
-				Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
+				Assertion.Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
 			} 
 			catch (ArgumentOutOfRangeException) {}
 
 			comment.Value = "foo";
 			comment.InsertData (3, "bar");
-			AssertEquals ("foobar", comment.Data);
+			Assertion.AssertEquals ("foobar", comment.Data);
 
 			try 
 			{
 				comment.Value = "foo";
 				comment.InsertData (4, "bar");
-				Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
+				Assertion.Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
 			} 
 			catch (ArgumentOutOfRangeException) {}
 
@@ -117,33 +120,34 @@ namespace MonoTests.System.Xml
 			{
 				comment.Value = "foo";
 				comment.InsertData (1, null);
-				Fail ("Expected an ArgumentNullException to be thrown.");
+				Assertion.Fail ("Expected an ArgumentNullException to be thrown.");
 			} 
 			catch (ArgumentNullException) {}
 		}
 
-		public void TestReplaceData ()
+		[Test]
+		public void ReplaceData ()
 		{
 			changed = false;
 			changing = false;
 			comment.ReplaceData (0, 3, "bar");
-			Assert (changed);
-			Assert (changing);
-			AssertEquals ("bar", comment.Data);
+			Assertion.Assert (changed);
+			Assertion.Assert (changing);
+			Assertion.AssertEquals ("bar", comment.Data);
 
 			comment.Value = "foo";
 			comment.ReplaceData (2, 3, "bar");
-			AssertEquals ("fobar", comment.Data);
+			Assertion.AssertEquals ("fobar", comment.Data);
 
 			comment.Value = "foo";
 			comment.ReplaceData (3, 3, "bar");
-			AssertEquals ("foobar", comment.Data);
+			Assertion.AssertEquals ("foobar", comment.Data);
 
 			try 
 			{
 				comment.Value = "foo";
 				comment.ReplaceData (4, 3, "bar");
-				Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
+				Assertion.Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
 			} 
 			catch (ArgumentOutOfRangeException) {}
 
@@ -151,23 +155,23 @@ namespace MonoTests.System.Xml
 			{
 				comment.Value = "foo";
 				comment.ReplaceData (-1, 3, "bar");
-				Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
+				Assertion.Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
 			} 
 			catch (ArgumentOutOfRangeException) {}
 
 			comment.Value = "foo";
 			comment.ReplaceData (0, 2, "bar");
-			AssertEquals ("baro", comment.Data);
+			Assertion.AssertEquals ("baro", comment.Data);
 
 			comment.Value = "foo";
 			comment.ReplaceData (0, 5, "bar");
-			AssertEquals ("bar", comment.Data);
+			Assertion.AssertEquals ("bar", comment.Data);
 
 			try 
 			{
 				comment.Value = "foo";
 				comment.ReplaceData (1, 1, null);
-				Fail ("Expected an ArgumentNullException to be thrown.");
+				Assertion.Fail ("Expected an ArgumentNullException to be thrown.");
 			} 
 			catch (ArgumentNullException) {}
 		}

+ 33 - 28
mcs/class/System.XML/Test/XmlCommentTests.cs

@@ -1,10 +1,11 @@
 //
 // System.Xml.XmlCommentTests.cs
 //
-// Author:
-//	Duncan Mak  ([email protected])
+// Author: Duncan Mak  ([email protected])
+// Author: Martin Willemoes Hansen ([email protected])
 //
 // (C) Ximian, Inc.
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -14,7 +15,8 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlCommentTests : TestCase
+	[TestFixture]
+	public class XmlCommentTests
 	{
 		XmlDocument document;
 		XmlComment comment;
@@ -22,73 +24,76 @@ namespace MonoTests.System.Xml
 		XmlNode deep;
 		XmlNode shallow;
 
-		public XmlCommentTests () : base ("MonoTests.System.Xml.XmlCommentTests testsuite") {}
-
-		public XmlCommentTests (string name) : base (name) {}
-
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 		}
 
-		public void TestXmlCommentCloneNode ()
+		[Test]
+		public void XmlCommentCloneNode ()
 		{
 			document.LoadXml ("<root><foo></foo></root>");
 			comment = document.CreateComment ("Comment");
 			original = comment;
 
 			shallow = comment.CloneNode (false); // shallow
-			TestXmlNodeBaseProperties (original, shallow);
+			XmlNodeBaseProperties (original, shallow);
 			
 			deep = comment.CloneNode (true); // deep
-			TestXmlNodeBaseProperties (original, deep);
-			AssertEquals ("Value incorrectly cloned",
+			XmlNodeBaseProperties (original, deep);
+			Assertion.AssertEquals ("Value incorrectly cloned",
 				original.Value, deep.Value);
 
-			AssertEquals ("deep cloning differs from shallow cloning",
+			Assertion.AssertEquals ("deep cloning differs from shallow cloning",
 				deep.OuterXml, shallow.OuterXml);
 		}
 
-		public void TestXmlCommentInnerAndOuterXml ()
+		[Test]
+		public void XmlCommentInnerAndOuterXml ()
 		{
 			comment = document.CreateComment ("foo");
-			AssertEquals (String.Empty, comment.InnerXml);
-			AssertEquals ("<!--foo-->", comment.OuterXml);
+			Assertion.AssertEquals (String.Empty, comment.InnerXml);
+			Assertion.AssertEquals ("<!--foo-->", comment.OuterXml);
 		}
 
-		public void TestXmlCommentIsReadOnly ()
+		[Test]
+		public void XmlCommentIsReadOnly ()
 		{
 			document.LoadXml ("<root><foo></foo></root>");
 			comment = document.CreateComment ("Comment");
-			AssertEquals ("XmlComment IsReadOnly property broken",
+			Assertion.AssertEquals ("XmlComment IsReadOnly property broken",
 				comment.IsReadOnly, false);
 		}
 
-		public void TestXmlCommentLocalName ()
+		[Test]
+		public void XmlCommentLocalName ()
 		{
 			document.LoadXml ("<root><foo></foo></root>");
 			comment = document.CreateComment ("Comment");
-			AssertEquals (comment.NodeType + " LocalName property broken",
+			Assertion.AssertEquals (comment.NodeType + " LocalName property broken",
 				      comment.LocalName, "#comment");
 		}
 
-		public void TestXmlCommentName ()
+		[Test]
+		public void XmlCommentName ()
 		{
 			document.LoadXml ("<root><foo></foo></root>");
 			comment = document.CreateComment ("Comment");
-			AssertEquals (comment.NodeType + " Name property broken",
+			Assertion.AssertEquals (comment.NodeType + " Name property broken",
 				comment.Name, "#comment");
 		}
 
-		public void TestXmlCommentNodeType ()
+		[Test]
+		public void XmlCommentNodeType ()
 		{
 			document.LoadXml ("<root><foo></foo></root>");
 			comment = document.CreateComment ("Comment");
-			AssertEquals ("XmlComment NodeType property broken",
+			Assertion.AssertEquals ("XmlComment NodeType property broken",
 				      comment.NodeType.ToString (), "Comment");
 		}
 
-		internal void TestXmlNodeBaseProperties (XmlNode original, XmlNode cloned)
+		internal void XmlNodeBaseProperties (XmlNode original, XmlNode cloned)
 		{
 			document.LoadXml ("<root><foo></foo></root>");
 			comment = document.CreateComment ("Comment");
@@ -96,11 +101,11 @@ namespace MonoTests.System.Xml
 			//			assertequals (original.nodetype + " was incorrectly cloned.",
 			//				      original.baseuri, cloned.baseuri);			
 
-			AssertNull (cloned.ParentNode);
-			AssertEquals ("Value incorrectly cloned",
+			Assertion.AssertNull (cloned.ParentNode);
+			Assertion.AssertEquals ("Value incorrectly cloned",
 				original.Value, cloned.Value);
 
-			Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
+			Assertion.Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
 		}
        
 	}

+ 55 - 49
mcs/class/System.XML/Test/XmlDeclarationTests.cs

@@ -1,10 +1,11 @@
 //
 // System.Xml.XmlDeclarationTests.cs
 //
-// Author:
-// 	Duncan Mak  ([email protected])
+// Author: Duncan Mak  ([email protected])
+// Author: Martin Willemoes Hansen ([email protected])
 //
 // (C) Ximian, Inc.
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -14,55 +15,54 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlDeclarationTests : TestCase
+	[TestFixture]
+	public class XmlDeclarationTests
 	{
-
 		XmlDocument document;
 		XmlDeclaration declaration;
 		
-		public XmlDeclarationTests () : base ("MonoTests.System.Xml.XmlDeclarationTests testsuite") {}
-		
-		public XmlDeclarationTests (string name) : base (name) {}
-
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 			document.LoadXml ("<foo><bar></bar></foo>");
 			declaration = document.CreateXmlDeclaration ("1.0", null, null);
 		}
 
-		public void TestInnerAndOuterXml ()
+		[Test]
+		public void InnerAndOuterXml ()
 		{
 			declaration = document.CreateXmlDeclaration ("1.0", null, null);
-			AssertEquals (String.Empty, declaration.InnerXml);
-			AssertEquals ("<?xml version=\"1.0\"?>", declaration.OuterXml);
+			Assertion.AssertEquals (String.Empty, declaration.InnerXml);
+			Assertion.AssertEquals ("<?xml version=\"1.0\"?>", declaration.OuterXml);
 
 			declaration = document.CreateXmlDeclaration ("1.0", "doesn't check", null);
-			AssertEquals (String.Empty, declaration.InnerXml);
-			AssertEquals ("<?xml version=\"1.0\" encoding=\"doesn't check\"?>", declaration.OuterXml);
+			Assertion.AssertEquals (String.Empty, declaration.InnerXml);
+			Assertion.AssertEquals ("<?xml version=\"1.0\" encoding=\"doesn't check\"?>", declaration.OuterXml);
 
 			declaration = document.CreateXmlDeclaration ("1.0", null, "yes");
-			AssertEquals (String.Empty, declaration.InnerXml);
-			AssertEquals ("<?xml version=\"1.0\" standalone=\"yes\"?>", declaration.OuterXml);
+			Assertion.AssertEquals (String.Empty, declaration.InnerXml);
+			Assertion.AssertEquals ("<?xml version=\"1.0\" standalone=\"yes\"?>", declaration.OuterXml);
 
 			declaration = document.CreateXmlDeclaration ("1.0", "foo", "no");
-			AssertEquals (String.Empty, declaration.InnerXml);
-			AssertEquals ("<?xml version=\"1.0\" encoding=\"foo\" standalone=\"no\"?>", declaration.OuterXml);
+			Assertion.AssertEquals (String.Empty, declaration.InnerXml);
+			Assertion.AssertEquals ("<?xml version=\"1.0\" encoding=\"foo\" standalone=\"no\"?>", declaration.OuterXml);
 		}
 
-		internal void TestXmlNodeBaseProperties (XmlNode original, XmlNode cloned)
+		internal void XmlNodeBaseProperties (XmlNode original, XmlNode cloned)
 		{
 //			assertequals (original.nodetype + " was incorrectly cloned.",
 //				      original.baseuri, cloned.baseuri);			
-			AssertNull (cloned.ParentNode);
+			Assertion.AssertNull (cloned.ParentNode);
 
-			AssertEquals ("Value incorrectly cloned",
+			Assertion.AssertEquals ("Value incorrectly cloned",
 				      original.Value, cloned.Value);
 			
-                        Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
+                        Assertion.Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
 		}
 
-		public void TestConstructor ()
+		[Test]
+		public void Constructor ()
 		{
 			try {
 				XmlDeclaration broken = document.CreateXmlDeclaration ("2.0", null, null);
@@ -70,83 +70,89 @@ namespace MonoTests.System.Xml
 				return;
 
 			} catch (Exception e) {
-				Fail("first arg null, wrong exception: " + e.ToString());
+				Assertion.Fail("first arg null, wrong exception: " + e.ToString());
 			}
 		}
 
-		public void TestNodeType ()
+		[Test]
+		public void NodeType ()
 		{
-			AssertEquals ("incorrect NodeType returned", XmlNodeType.XmlDeclaration, declaration.NodeType);
+			Assertion.AssertEquals ("incorrect NodeType returned", XmlNodeType.XmlDeclaration, declaration.NodeType);
 		}
 
-		public void TestNames ()
+		[Test]
+		public void Names ()
 		{
-			AssertEquals ("Name is incorrect", "xml", declaration.Name);
-			AssertEquals ("LocalName is incorrect", "xml", declaration.LocalName);
+			Assertion.AssertEquals ("Name is incorrect", "xml", declaration.Name);
+			Assertion.AssertEquals ("LocalName is incorrect", "xml", declaration.LocalName);
 		}
 
-		public void TestEncodingProperty ()
+		[Test]
+		public void EncodingProperty ()
 		{
 			XmlDeclaration d1 = document.CreateXmlDeclaration ("1.0", "foo", null);
-			AssertEquals ("Encoding property", "foo", d1.Encoding);
+			Assertion.AssertEquals ("Encoding property", "foo", d1.Encoding);
 
 			XmlDeclaration d2 = document.CreateXmlDeclaration ("1.0", null, null);
-			AssertEquals ("null Encoding property", String.Empty, d2.Encoding);
+			Assertion.AssertEquals ("null Encoding property", String.Empty, d2.Encoding);
 		}
 
-		public void TestStandaloneProperty ()
+		[Test]
+		public void StandaloneProperty ()
 		{
 			XmlDeclaration d1 = document.CreateXmlDeclaration ("1.0", null, "yes");
-			AssertEquals ("Yes standalone property", "yes", d1.Standalone);
+			Assertion.AssertEquals ("Yes standalone property", "yes", d1.Standalone);
 
 			XmlDeclaration d2 = document.CreateXmlDeclaration ("1.0", null, "no");
-			AssertEquals ("No standalone property", "no", d2.Standalone);
+			Assertion.AssertEquals ("No standalone property", "no", d2.Standalone);
 
 			XmlDeclaration d3 = document.CreateXmlDeclaration ("1.0", null, null);
-			AssertEquals ("null Standalone property", String.Empty, d3.Standalone);
+			Assertion.AssertEquals ("null Standalone property", String.Empty, d3.Standalone);
 		}
 
-		public void TestValueProperty ()
+		[Test]
+		public void ValueProperty ()
 		{
 			string expected = "version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"yes\"" ;
 
 			XmlDeclaration d = document.CreateXmlDeclaration ("1.0", "ISO-8859-1", "yes");
-			AssertEquals ("Value property", expected, d.Value);
+			Assertion.AssertEquals ("Value property", expected, d.Value);
 
 			d.Value = expected;
-			AssertEquals ("Value round-trip", expected, d.Value);
+			Assertion.AssertEquals ("Value round-trip", expected, d.Value);
 
 			d.Value = "   " + expected;
-			AssertEquals ("Value round-trip (padded)", expected, d.Value);
+			Assertion.AssertEquals ("Value round-trip (padded)", expected, d.Value);
 
 			d.Value = "version=\"1.0\"     encoding=\"ISO-8859-1\" standalone=\"yes\"" ;
-			AssertEquals ("Value round-trip (padded 2)", expected, d.Value);
+			Assertion.AssertEquals ("Value round-trip (padded 2)", expected, d.Value);
 
 			d.Value = "version=\"1.0\"\tencoding=\"ISO-8859-1\" standalone=\"yes\"" ;
-			AssertEquals ("Value round-trip (\\t)", expected, d.Value);
+			Assertion.AssertEquals ("Value round-trip (\\t)", expected, d.Value);
 
 			d.Value = "version=\"1.0\"\n    encoding=\"ISO-8859-1\" standalone=\"yes\"" ;
-			AssertEquals ("Value round-trip (\\n)", expected, d.Value);
+			Assertion.AssertEquals ("Value round-trip (\\n)", expected, d.Value);
 
 			d.Value = "version=\"1.0\"    encoding	=   \"ISO-8859-1\" standalone = \"yes\"" ;
-			AssertEquals ("Value round-trip (spaces)", expected, d.Value);
+			Assertion.AssertEquals ("Value round-trip (spaces)", expected, d.Value);
 
 			d.Value = "version='1.0' encoding='ISO-8859-1' standalone='yes'" ;
-			AssertEquals ("Value round-trip ('s)", expected, d.Value);
+			Assertion.AssertEquals ("Value round-trip ('s)", expected, d.Value);
 
 		}
 
-		public void TestXmlCommentCloneNode ()
+		[Test]
+		public void XmlCommentCloneNode ()
 		{
 			XmlNode original = declaration;
 
 			XmlNode shallow = declaration.CloneNode (false); // shallow
-			TestXmlNodeBaseProperties (original, shallow);
+			XmlNodeBaseProperties (original, shallow);
 			
 			XmlNode deep = declaration.CloneNode (true); // deep
-			TestXmlNodeBaseProperties (original, deep);
+			XmlNodeBaseProperties (original, deep);
 
-                        AssertEquals ("deep cloning differs from shallow cloning",
+                        Assertion.AssertEquals ("deep cloning differs from shallow cloning",
 				      deep.OuterXml, shallow.OuterXml);
 		}
 	}

+ 28 - 29
mcs/class/System.XML/Test/XmlDocumentFragmentTests.cs

@@ -2,8 +2,10 @@
 // System.Xml.XmlDocumentFragment.cs
 //
 // Author: Atsushi Enomoto ([email protected])
+// Author: Martin Willemoes Hansen ([email protected])
 //
 // (C) 2002 Atsushi Enomoto
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -13,29 +15,23 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlDocumentFragmentTests : TestCase
+	[TestFixture]
+	public class XmlDocumentFragmentTests
 	{
 		XmlDocument document;
 		XmlDocumentFragment fragment;
-		
-		public XmlDocumentFragmentTests (string name)
-			: base (name)
-		{
-		}
-
-		protected override void SetUp ()
-		{
-		}
 
-		public void TestConstructor ()
+		[Test]
+		public void Constructor ()
 		{
 			XmlDocument d = new XmlDocument ();
 			XmlDocumentFragment df = d.CreateDocumentFragment ();
-			AssertEquals ("#Constructor.NodeName", "#document-fragment", df.Name);
-			AssertEquals ("#Constructor.NodeType", XmlNodeType.DocumentFragment, df.NodeType);
+			Assertion.AssertEquals ("#Constructor.NodeName", "#document-fragment", df.Name);
+			Assertion.AssertEquals ("#Constructor.NodeType", XmlNodeType.DocumentFragment, df.NodeType);
 		}
 
-		public void TestAppendChildToFragment ()
+		[Test]
+		public void AppendChildToFragment ()
 		{
 			document = new XmlDocument ();
 			fragment = document.CreateDocumentFragment ();
@@ -45,12 +41,13 @@ namespace MonoTests.System.Xml
 
 			// appending element to fragment
 			fragment.AppendChild (el);
-			AssertNotNull ("#AppendChildToFragment.Element", fragment.FirstChild);
-			AssertNotNull ("#AppendChildToFragment.Element.Children", fragment.FirstChild.FirstChild);
-			AssertEquals ("#AppendChildToFragment.Element.Child.Text", "Test Paragraph", fragment.FirstChild.FirstChild.Value);
+			Assertion.AssertNotNull ("#AppendChildToFragment.Element", fragment.FirstChild);
+			Assertion.AssertNotNull ("#AppendChildToFragment.Element.Children", fragment.FirstChild.FirstChild);
+			Assertion.AssertEquals ("#AppendChildToFragment.Element.Child.Text", "Test Paragraph", fragment.FirstChild.FirstChild.Value);
 		}
 
-		public void TestAppendFragmentToElement ()
+		[Test]
+		public void AppendFragmentToElement ()
 		{
 			document = new XmlDocument ();
 			fragment = document.CreateDocumentFragment ();
@@ -61,13 +58,14 @@ namespace MonoTests.System.Xml
 
 			// appending fragment to element
 			body.AppendChild (fragment);
-			AssertNotNull ("#AppendFragmentToElement.Exist", body.FirstChild);
-			AssertEquals ("#AppendFragmentToElement.ChildIsElement", XmlNodeType.Element, body.FirstChild.NodeType);
-			AssertEquals ("#AppendFragmentToElement.FirstChild", "p", body.FirstChild.Name);
-			AssertEquals ("#AppendFragmentToElement.LastChild", "div", body.LastChild.Name);
+			Assertion.AssertNotNull ("#AppendFragmentToElement.Exist", body.FirstChild);
+			Assertion.AssertEquals ("#AppendFragmentToElement.ChildIsElement", XmlNodeType.Element, body.FirstChild.NodeType);
+			Assertion.AssertEquals ("#AppendFragmentToElement.FirstChild", "p", body.FirstChild.Name);
+			Assertion.AssertEquals ("#AppendFragmentToElement.LastChild", "div", body.LastChild.Name);
 		}
 
-		public void TestGetInnerXml ()
+		[Test]
+		public void GetInnerXml ()
 		{
 			// this will be also tests of TestWriteTo()/TestWriteContentTo()
 
@@ -76,18 +74,19 @@ namespace MonoTests.System.Xml
 			fragment.AppendChild (document.CreateElement ("foo"));
 			fragment.AppendChild (document.CreateElement ("bar"));
 			fragment.AppendChild (document.CreateElement ("baz"));
-			AssertEquals ("#Simple", "<foo /><bar /><baz />", fragment.InnerXml);
+			Assertion.AssertEquals ("#Simple", "<foo /><bar /><baz />", fragment.InnerXml);
 		}
 
-		public void TestSetInnerXml ()
+		[Test]
+		public void SetInnerXml ()
 		{
 			document = new XmlDocument ();
 			fragment = document.CreateDocumentFragment ();
 			fragment.InnerXml = "<foo /><bar><child /></bar><baz />";
-			AssertEquals ("foo", fragment.FirstChild.Name);
-			AssertEquals ("bar", fragment.FirstChild.NextSibling.Name);
-			AssertEquals ("child", fragment.FirstChild.NextSibling.FirstChild.Name);
-			AssertEquals ("baz", fragment.LastChild.Name);
+			Assertion.AssertEquals ("foo", fragment.FirstChild.Name);
+			Assertion.AssertEquals ("bar", fragment.FirstChild.NextSibling.Name);
+			Assertion.AssertEquals ("child", fragment.FirstChild.NextSibling.FirstChild.Name);
+			Assertion.AssertEquals ("baz", fragment.LastChild.Name);
 		}
 	}
 }

Fichier diff supprimé car celui-ci est trop grand
+ 249 - 215
mcs/class/System.XML/Test/XmlDocumentTests.cs


+ 33 - 31
mcs/class/System.XML/Test/XmlDocumentTypeTests.cs

@@ -2,8 +2,10 @@
 // System.Xml.XmlDocumentTypeTests.cs
 //
 // Author: Duncan Mak  ([email protected])
+// Author: Martin Willemoes Hansen ([email protected])
 //
 // (C) Ximian, Inc.
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -13,56 +15,53 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlDocumentTypeTests : TestCase
+	[TestFixture]
+	public class XmlDocumentTypeTests
 	{
 		XmlDocument document;
 		XmlDocumentType docType;
-		public XmlDocumentTypeTests ()
-			: base ("MonoTests.System.Xml.XmlDocumentTypeTests testsuite")
-		{
-		}
-
-		public XmlDocumentTypeTests (string name)
-			: base (name)
-		{
-		}
 
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 			docType = document.CreateDocumentType ("book", null, null, "<!ELEMENT book ANY>");
 			document.AppendChild (docType);
 		}
 
-		internal void TestXmlNodeBaseProperties (XmlNode original, XmlNode cloned)
+		internal void XmlNodeBaseProperties (XmlNode original, XmlNode cloned)
 		{
 //			assertequals (original.nodetype + " was incorrectly cloned.",
 //				      original.baseuri, cloned.baseuri);			
 
-			AssertNull (cloned.ParentNode);
-			AssertEquals ("Value incorrectly cloned",
+			Assertion.AssertNull (cloned.ParentNode);
+			Assertion.AssertEquals ("Value incorrectly cloned",
 				      original.Value, cloned.Value);
 
-                        Assert ("Copies, not pointers", !Object.ReferenceEquals (original, cloned));
+                        Assertion.Assert ("Copies, not pointers", !Object.ReferenceEquals (original, cloned));
 		}
 
-		public void TestName ()
+		[Test]
+		public void Name ()
 		{
-			AssertEquals ("Getting Name property", "book", docType.Name);
+			Assertion.AssertEquals ("Getting Name property", "book", docType.Name);
 		}
 
-		public void TestLocalName ()
+		[Test]
+		public void LocalName ()
 		{
-			AssertEquals ("Getting LocalName property", "book", docType.LocalName);
+			Assertion.AssertEquals ("Getting LocalName property", "book", docType.LocalName);
 		}
 
-		public void TestInternalSubset ()
+		[Test]
+		public void InternalSubset ()
 		{
-			AssertEquals ("Getting Internal Subset property",
+			Assertion.AssertEquals ("Getting Internal Subset property",
 				      "<!ELEMENT book ANY>", docType.InternalSubset);
 		}
 
-		public void TestAppendChild ()
+		[Test]
+		public void AppendChild ()
 		{
 			try {
 				XmlDocumentType type1 = document.CreateDocumentType ("book", null, null, null);
@@ -72,32 +71,35 @@ namespace MonoTests.System.Xml
 				return;
 
 			} catch (Exception) {				
-				Fail ("Incorrect Exception thrown.");
+				Assertion.Fail ("Incorrect Exception thrown.");
 			}
 		}
 
-		public void TestNodeType ()
+		[Test]
+		public void NodeType ()
 		{
-			AssertEquals ("NodeType property broken",
+			Assertion.AssertEquals ("NodeType property broken",
 				      docType.NodeType.ToString (), "DocumentType");
 		}
 		
-		public void TestIsReadOnly ()
+		[Test]
+		public void IsReadOnly ()
 		{
-			AssertEquals ("IsReadOnly property", "True", docType.IsReadOnly.ToString ());
+			Assertion.AssertEquals ("IsReadOnly property", "True", docType.IsReadOnly.ToString ());
 		}
 
-		public void TestCloneNode ()
+		[Test]
+		public void CloneNode ()
 		{
 			XmlNode original = docType;
 
 			XmlNode cloned1 = docType.CloneNode (true);
-			TestXmlNodeBaseProperties (original, cloned1);
+			XmlNodeBaseProperties (original, cloned1);
 
 			XmlNode cloned2 = docType.CloneNode (false);
-			TestXmlNodeBaseProperties (original, cloned2);
+			XmlNodeBaseProperties (original, cloned2);
 
-			AssertEquals ("Deep and shallow cloning", cloned1.Value, cloned2.Value);
+			Assertion.AssertEquals ("Deep and shallow cloning", cloned1.Value, cloned2.Value);
 		}
 	       
 	}

+ 98 - 78
mcs/class/System.XML/Test/XmlElementTests.cs

@@ -1,10 +1,12 @@
 //
 // XmlElementTests
 //
-// Author:
+// Authors:
 //   Jason Diamond ([email protected])
+//   Martin Willemoes Hansen ([email protected])
 //
 // (C) 2002 Jason Diamond  http://injektilo.org/
+// (C) 2003 Martin Willemoes Hansen 
 //
 
 using System;
@@ -16,14 +18,13 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlElementTests : TestCase
+	[TestFixture]
+	public class XmlElementTests 
 	{
-		public XmlElementTests () : base ("MonoTests.System.Xml.XmlElementTests testsuite") { }
-		public XmlElementTests (string name) : base (name) { }
-
 		private XmlDocument document;
 
-		protected override void SetUp()
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 		}
@@ -32,11 +33,11 @@ namespace MonoTests.System.Xml
 					    string localName, string namespaceURI,
 					    int attributesCount)
 		{
-			AssertEquals (prefix != String.Empty ? prefix + ":" + localName : localName, element.Name);
-			AssertEquals (prefix, element.Prefix);
-			AssertEquals (localName, element.LocalName);
-			AssertEquals (namespaceURI, element.NamespaceURI);
-			//AssertEquals (attributesCount, element.Attributes.Count);
+			Assertion.AssertEquals (prefix != String.Empty ? prefix + ":" + localName : localName, element.Name);
+			Assertion.AssertEquals (prefix, element.Prefix);
+			Assertion.AssertEquals (localName, element.LocalName);
+			Assertion.AssertEquals (namespaceURI, element.NamespaceURI);
+			//Assertion.AssertEquals (attributesCount, element.Attributes.Count);
 		}
 
 		// for NodeInserted Event
@@ -60,8 +61,8 @@ namespace MonoTests.System.Xml
 			Removed = true;
 		}
 
-
-		public void TestCloneNode ()
+		[Test]
+		public void CloneNode ()
 		{
 			XmlElement element = document.CreateElement ("foo");
 			XmlElement child = document.CreateElement ("bar");
@@ -75,93 +76,102 @@ namespace MonoTests.System.Xml
                         
 			document.AppendChild (element);
 			XmlNode deep = element.CloneNode (true);
-			// AssertEquals ("These should be the same", deep.OuterXml, element.OuterXml); 
-			AssertNull ("This is not null", deep.ParentNode);
-			Assert ("Copies, not pointers", !Object.ReferenceEquals (element,deep));
+			// Assertion.AssertEquals ("These should be the same", deep.OuterXml, element.OuterXml); 
+			Assertion.AssertNull ("This is not null", deep.ParentNode);
+			Assertion.Assert ("Copies, not pointers", !Object.ReferenceEquals (element,deep));
 
 			XmlNode shallow = element.CloneNode (false);
-			AssertNull ("This is not null", shallow.ParentNode);
-			Assert ("Copies, not pointers", !Object.ReferenceEquals (element,shallow));
-			AssertEquals ("Shallow clones shalt have no children!", false, shallow.HasChildNodes);
+			Assertion.AssertNull ("This is not null", shallow.ParentNode);
+			Assertion.Assert ("Copies, not pointers", !Object.ReferenceEquals (element,shallow));
+			Assertion.AssertEquals ("Shallow clones shalt have no children!", false, shallow.HasChildNodes);
 		}
 
-		public void TestCreateElement1 ()
+		[Test]
+		public void CreateElement1 ()
 		{
 			XmlElement element = document.CreateElement ("name");
 			AssertElement (element, String.Empty, "name", String.Empty, 0);
 		}
 
-		public void TestCreateElement1WithPrefix ()
+		[Test]
+		public void CreateElement1WithPrefix ()
 		{
 			XmlElement element = document.CreateElement ("prefix:localName");
 			AssertElement (element, "prefix", "localName", String.Empty, 0);
 		}
 
-		public void TestCreateElement2 ()
+		[Test]
+		public void CreateElement2 ()
 		{
 			XmlElement element = document.CreateElement ("qualifiedName", "namespaceURI");
 			AssertElement (element, String.Empty, "qualifiedName",
 				       "namespaceURI", 0);
 		}
 
-		public void TestCreateElement2WithPrefix ()
+		[Test]
+		public void CreateElement2WithPrefix ()
 		{
 			XmlElement element = document.CreateElement ("prefix:localName", "namespaceURI");
 			AssertElement (element, "prefix", "localName", "namespaceURI", 0);
 		}
 
-		public void TestCreateElement3 ()
+		[Test]
+		public void CreateElement3 ()
 		{
 			XmlElement element = document.CreateElement ("prefix", "localName", "namespaceURI");
 			AssertElement (element, "prefix", "localName", "namespaceURI", 0);
 		}
 
-		public void TestCreateElement3WithNullNamespace ()
+		[Test]
+		public void CreateElement3WithNullNamespace ()
 		{
 			// bug #26855, NamespaceURI should NEVER be null.
 			XmlElement element = document.CreateElement (null, "localName", null);
 			AssertElement (element, String.Empty, "localName", String.Empty, 0);
 		}
 
-		public void TestInnerAndOuterXml ()
+		[Test]
+		public void InnerAndOuterXml ()
 		{
 			XmlElement element;
 			XmlText text;
 			XmlComment comment;
 			
 			element = document.CreateElement ("foo");
-			AssertEquals (String.Empty, element.InnerXml);
-			AssertEquals ("<foo />", element.OuterXml);
+			Assertion.AssertEquals (String.Empty, element.InnerXml);
+			Assertion.AssertEquals ("<foo />", element.OuterXml);
 
 			text = document.CreateTextNode ("bar");
 			element.AppendChild (text);
-			AssertEquals ("bar", element.InnerXml);
-			AssertEquals ("<foo>bar</foo>", element.OuterXml);
+			Assertion.AssertEquals ("bar", element.InnerXml);
+			Assertion.AssertEquals ("<foo>bar</foo>", element.OuterXml);
 
 			element.SetAttribute ("baz", "quux");
-			AssertEquals ("bar", element.InnerXml);
-			AssertEquals ("<foo baz=\"quux\">bar</foo>", element.OuterXml);
+			Assertion.AssertEquals ("bar", element.InnerXml);
+			Assertion.AssertEquals ("<foo baz=\"quux\">bar</foo>", element.OuterXml);
 
 			comment = document.CreateComment ("squonk");
 			element.AppendChild (comment);
-			AssertEquals ("bar<!--squonk-->", element.InnerXml);
-			AssertEquals ("<foo baz=\"quux\">bar<!--squonk--></foo>", element.OuterXml);
+			Assertion.AssertEquals ("bar<!--squonk-->", element.InnerXml);
+			Assertion.AssertEquals ("<foo baz=\"quux\">bar<!--squonk--></foo>", element.OuterXml);
 
 			element.RemoveAll();
 			element.AppendChild(document.CreateElement("hoge"));
-			AssertEquals ("<hoge />", element.InnerXml);
+			Assertion.AssertEquals ("<hoge />", element.InnerXml);
 		}
 
-		public void TestSetGetAttribute ()
+		[Test]
+		public void SetGetAttribute ()
 		{
 			XmlElement element = document.CreateElement ("foo");
 			element.SetAttribute ("attr1", "val1");
 			element.SetAttribute ("attr2", "val2");
-			AssertEquals ("val1", element.GetAttribute ("attr1"));
-			AssertEquals ("val2", element.GetAttribute ("attr2"));
+			Assertion.AssertEquals ("val1", element.GetAttribute ("attr1"));
+			Assertion.AssertEquals ("val2", element.GetAttribute ("attr2"));
 		}
 
-		public void TestGetElementsByTagNameNoNameSpace ()
+		[Test]
+		public void GetElementsByTagNameNoNameSpace ()
 		{
 			string xml = @"<library><book><title>XML Fun</title><author>John Doe</author>
 				<price>34.95</price></book><book><title>Bear and the Dragon</title>
@@ -178,10 +188,11 @@ namespace MonoTests.System.Xml
 			XmlNode xmlNode = libraryList.Item (0);
 			XmlElement xmlElement = xmlNode as XmlElement;
 			XmlNodeList bookList = xmlElement.GetElementsByTagName ("book");
-			AssertEquals ("GetElementsByTagName (string) returned incorrect count.", 4, bookList.Count);
+			Assertion.AssertEquals ("GetElementsByTagName (string) returned incorrect count.", 4, bookList.Count);
 		}
 
-		public void TestGetElementsByTagNameUsingNameSpace ()
+		[Test]
+		public void GetElementsByTagNameUsingNameSpace ()
 		{
 			StringBuilder xml = new StringBuilder ();
 			xml.Append ("<?xml version=\"1.0\" ?><library xmlns:North=\"http://www.foo.com\" ");
@@ -204,16 +215,18 @@ namespace MonoTests.System.Xml
 			XmlNode xmlNode = libraryList.Item (0);
 			XmlElement xmlElement = xmlNode as XmlElement;
 			XmlNodeList bookList = xmlElement.GetElementsByTagName ("book", "http://www.foo.com");
-			AssertEquals ("GetElementsByTagName (string, uri) returned incorrect count.", 1, bookList.Count);
+			Assertion.AssertEquals ("GetElementsByTagName (string, uri) returned incorrect count.", 1, bookList.Count);
 		}
 
-		public void TestOuterXmlWithNamespace ()
+		[Test]
+		public void OuterXmlWithNamespace ()
 		{
 			XmlElement element = document.CreateElement ("foo", "bar", "#foo");
-			AssertEquals ("<foo:bar xmlns:foo=\"#foo\" />", element.OuterXml);
+			Assertion.AssertEquals ("<foo:bar xmlns:foo=\"#foo\" />", element.OuterXml);
 		}		
 
-		public void TestRemoveAllAttributes ()
+		[Test]
+		public void RemoveAllAttributes ()
 		{
 			StringBuilder xml = new StringBuilder ();
 			xml.Append ("<?xml version=\"1.0\" ?><library><book type=\"non-fiction\" price=\"34.95\"> ");
@@ -227,48 +240,51 @@ namespace MonoTests.System.Xml
 			XmlNode xmlNode = bookList.Item (0);
 			XmlElement xmlElement = xmlNode as XmlElement;
 			xmlElement.RemoveAllAttributes ();
-			AssertEquals ("attributes not properly removed.", false, xmlElement.HasAttribute ("type"));
+			Assertion.AssertEquals ("attributes not properly removed.", false, xmlElement.HasAttribute ("type"));
 		}
 
-		public void TestSetAttributeNode ()
+		[Test]
+		public void SetAttributeNode ()
 		{
 			XmlDocument xmlDoc = new XmlDocument ();
 			XmlElement xmlEl = xmlDoc.CreateElement ("TestElement");
 			XmlAttribute xmlAttribute = xmlEl.SetAttributeNode ("attr1", "namespace1");
 			XmlAttribute xmlAttribute2 = xmlEl.SetAttributeNode ("attr2", "namespace2");
-			AssertEquals ("attribute name not properly created.", true, xmlAttribute.Name.Equals ("attr1"));
-			AssertEquals ("attribute namespace not properly created.", true, xmlAttribute.NamespaceURI.Equals ("namespace1"));
+			Assertion.AssertEquals ("attribute name not properly created.", true, xmlAttribute.Name.Equals ("attr1"));
+			Assertion.AssertEquals ("attribute namespace not properly created.", true, xmlAttribute.NamespaceURI.Equals ("namespace1"));
 		}
 
-		public void TestInnerXmlSetter ()
+		[Test]
+		public void InnerXmlSetter ()
 		{
 			XmlDocument doc = new XmlDocument ();
 			doc.LoadXml ("<root/>");
 			XmlElement el =  doc.DocumentElement;
-			AssertNull ("#Simple", el.FirstChild);
+			Assertion.AssertNull ("#Simple", el.FirstChild);
 			el.InnerXml = "<foo><bar att='baz'/></foo>";
 			XmlElement child = el.FirstChild as XmlElement;
-			AssertNotNull ("#Simple.Child", child);
-			AssertEquals ("#Simple.Child.Name", "foo", child.LocalName);
+			Assertion.AssertNotNull ("#Simple.Child", child);
+			Assertion.AssertEquals ("#Simple.Child.Name", "foo", child.LocalName);
 
 			XmlElement grandchild = child.FirstChild as XmlElement;
-			AssertNotNull ("#Simple.GrandChild", grandchild);
-			AssertEquals ("#Simple.GrandChild.Name", "bar", grandchild.LocalName);
-			AssertEquals ("#Simple.GrandChild.Attr", "baz", grandchild.GetAttribute ("att"));
+			Assertion.AssertNotNull ("#Simple.GrandChild", grandchild);
+			Assertion.AssertEquals ("#Simple.GrandChild.Name", "bar", grandchild.LocalName);
+			Assertion.AssertEquals ("#Simple.GrandChild.Attr", "baz", grandchild.GetAttribute ("att"));
 
 			doc.LoadXml ("<root xmlns='NS0' xmlns:ns1='NS1'><foo/><ns1:bar/><ns2:bar xmlns:ns2='NS2' /></root>");
 			el = doc.DocumentElement.FirstChild.NextSibling as XmlElement;	// ns1:bar
-			AssertNull ("#Namespaced.Prepare", el.FirstChild);
+			Assertion.AssertNull ("#Namespaced.Prepare", el.FirstChild);
 			el.InnerXml = "<ns1:baz />";
-			AssertNotNull ("#Namespaced.Child", el.FirstChild);
-			AssertEquals ("#Namespaced.Child.Name", "baz", el.FirstChild.LocalName);
-			AssertEquals ("#Namespaced.Child.NSURI", "NS1", el.FirstChild.NamespaceURI);	// important!
+			Assertion.AssertNotNull ("#Namespaced.Child", el.FirstChild);
+			Assertion.AssertEquals ("#Namespaced.Child.Name", "baz", el.FirstChild.LocalName);
+			Assertion.AssertEquals ("#Namespaced.Child.NSURI", "NS1", el.FirstChild.NamespaceURI);	// important!
 
 			el.InnerXml = "<hoge />";
-			AssertEquals ("#Namespaced.VerifyPreviousCleared", "hoge", el.FirstChild.Name);
+			Assertion.AssertEquals ("#Namespaced.VerifyPreviousCleared", "hoge", el.FirstChild.Name);
 		}
 
-		public void TestRemoveAttribute ()
+		[Test]
+		public void RemoveAttribute ()
 		{
 			string xlinkURI = "http://www.w3.org/1999/XLink";
 			XmlDocument doc = new XmlDocument ();
@@ -276,40 +292,44 @@ namespace MonoTests.System.Xml
 
 			XmlElement el =  doc.DocumentElement;
 			el.RemoveAttribute ("a1");
-			AssertNull ("RemoveAttribute", el.GetAttributeNode ("a1"));
+			Assertion.AssertNull ("RemoveAttribute", el.GetAttributeNode ("a1"));
 			el.RemoveAttribute ("xlink:href");
-			AssertNull ("RemoveAttribute", el.GetAttributeNode ("href", xlinkURI));
+			Assertion.AssertNull ("RemoveAttribute", el.GetAttributeNode ("href", xlinkURI));
 			el.RemoveAllAttributes ();
-			AssertNull ("RemoveAllAttributes", el.GetAttributeNode ("a2"));
+			Assertion.AssertNull ("RemoveAllAttributes", el.GetAttributeNode ("a2"));
 		}
 
-		public void TestWriteToWithDefaultNamespace ()
+		[Test]
+		public void WriteToWithDefaultNamespace ()
 		{
 			XmlDocument doc = new XmlDocument ();
 			doc.LoadXml ("<RetrievalElement URI=\"\"xmlns=\"http://www.w3.org/2000/09/xmldsig#\" />");
 			StringWriter sw = new StringWriter ();
 			XmlTextWriter xtw = new XmlTextWriter (sw);
 			doc.DocumentElement.WriteTo (xtw);
-			AssertEquals ("<RetrievalElement URI=\"\" xmlns=\"http://www.w3.org/2000/09/xmldsig#\" />", sw.ToString());
+			Assertion.AssertEquals ("<RetrievalElement URI=\"\" xmlns=\"http://www.w3.org/2000/09/xmldsig#\" />", sw.ToString());
 		}
 
-		public void TestWriteToWithDeletedNamespacePrefix ()
+		[Test]
+		public void WriteToWithDeletedNamespacePrefix ()
 		{
 			XmlDocument doc = new XmlDocument ();
 			doc.LoadXml ("<root xmlns:foo='urn:dummy'><foo foo:bar='baz' /></root>");
 			doc.DocumentElement.RemoveAllAttributes ();
 
-			Assert (doc.DocumentElement.FirstChild.OuterXml.IndexOf("xmlns:foo") > 0);
+			Assertion.Assert (doc.DocumentElement.FirstChild.OuterXml.IndexOf("xmlns:foo") > 0);
 		}
 
-		public void TestWriteToWithDifferentNamespaceAttributes ()
+		[Test]
+		public void WriteToWithDifferentNamespaceAttributes ()
 		{
 			XmlDocument doc = new XmlDocument ();
 			doc.LoadXml ("<root xmlns:foo='urn:dummy' xmlns:html='http://www.w3.org/1999/xhtml' html:style='font-size: 1em'></root>");
-			Assert (doc.OuterXml.IndexOf ("xmlns:html=\"http://www.w3.org/1999/xhtml\"") > 0);
+			Assertion.Assert (doc.OuterXml.IndexOf ("xmlns:html=\"http://www.w3.org/1999/xhtml\"") > 0);
 		}
 
-		public void TestInnerTextAndEvent ()
+		[Test]
+		public void InnerTextAndEvent ()
 		{
 			XmlDocument doc = new XmlDocument ();
 			doc.LoadXml ("<root><child>text</child><child2><![CDATA[cdata]]></child2></root>");
@@ -320,18 +340,18 @@ namespace MonoTests.System.Xml
 			// If only one child of the element is Text node,
 			// then no events are fired.
 			doc.DocumentElement.FirstChild.InnerText = "no events fired.";
-			AssertEquals ("NoInsertEventFired", false, Inserted);
-			AssertEquals ("NoRemoveEventFired", false, Removed);
-			AssertEquals ("SetInnerTextToSingleText", "no events fired.", doc.DocumentElement.FirstChild.InnerText);
+			Assertion.AssertEquals ("NoInsertEventFired", false, Inserted);
+			Assertion.AssertEquals ("NoRemoveEventFired", false, Removed);
+			Assertion.AssertEquals ("SetInnerTextToSingleText", "no events fired.", doc.DocumentElement.FirstChild.InnerText);
 			Inserted = false;
 			Removed = false;
 
 			// if only one child of the element is CDataSection,
 			// then events are fired.
 			doc.DocumentElement.LastChild.InnerText = "events are fired.";
-			AssertEquals ("InsertedEventFired", true, Inserted);
-			AssertEquals ("RemovedEventFired", true, Removed);
-			AssertEquals ("SetInnerTextToCDataSection", "events are fired.", doc.DocumentElement.LastChild.InnerText);
+			Assertion.AssertEquals ("InsertedEventFired", true, Inserted);
+			Assertion.AssertEquals ("RemovedEventFired", true, Removed);
+			Assertion.AssertEquals ("SetInnerTextToCDataSection", "events are fired.", doc.DocumentElement.LastChild.InnerText);
 		}
 	}
 }

+ 9 - 12
mcs/class/System.XML/Test/XmlEntityReferenceTests.cs

@@ -1,10 +1,12 @@
 //
 // System.Xml.XmlEntityReference.cs
 //
-// Author:
+// Authors:
 //   Atsushi Enomoto <[email protected]>
+//   Martin Willemoes Hansen <[email protected]>
 //
 // (C) 2002 Atsushi Enomoto
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -13,23 +15,18 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlEntityReferenceTests : TestCase
+	[TestFixture]
+	public class XmlEntityReferenceTests
 	{
-		public XmlEntityReferenceTests () : base ("MonoTests.System.Xml.XmlEntityReferenceTests testsuite") {}
-		public XmlEntityReferenceTests (string name) : base (name) {}
-
-		protected override void SetUp ()
-		{
-		}
-
-		public void TestWriteTo ()
+		[Test]
+		public void WriteTo ()
 		{
 			XmlDocument doc = new XmlDocument();
 			doc.LoadXml("<root/>");
 			XmlEntityReference er = doc.CreateEntityReference("foo");
 			doc.DocumentElement.AppendChild(er);
-			AssertEquals ("Name", "foo", er.Name);
-			AssertEquals ("WriteTo", "<root>&foo;</root>", doc.DocumentElement.OuterXml);
+			Assertion.AssertEquals ("Name", "foo", er.Name);
+			Assertion.AssertEquals ("WriteTo", "<root>&foo;</root>", doc.DocumentElement.OuterXml);
 		}
 	}
 }

+ 55 - 48
mcs/class/System.XML/Test/XmlNamespaceManagerTests.cs

@@ -1,10 +1,12 @@
 //
 // XmlNamespaceManagerTests.cs
 //
-// Author:
+// Authors:
 //   Jason Diamond ([email protected])
+//   Martin Willemoes Hansen ([email protected])
 //
 // (C) 2002 Jason Diamond  http://injektilo.org/
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -14,24 +16,24 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlNamespaceManagerTests : TestCase
+	[TestFixture]
+	public class XmlNamespaceManagerTests
 	{
-		public XmlNamespaceManagerTests () : base ("MonoTests.System.Xml.XmlNameSpaceManagerTests testsuite") { }
-		public XmlNamespaceManagerTests (string name) : base (name) { }
-
 		private XmlNameTable nameTable;
 		private XmlNamespaceManager namespaceManager;
 
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			nameTable = new NameTable ();
 			namespaceManager = new XmlNamespaceManager (nameTable);
 		}
 
-		public void TestNewNamespaceManager ()
+		[Test]
+		public void NewNamespaceManager ()
 		{
 			// make sure that you can call PopScope when there aren't any to pop.
-			Assert (!namespaceManager.PopScope ());
+			Assertion.Assert (!namespaceManager.PopScope ());
 
 			// the following strings should have been added to the name table by the
 			// namespace manager.
@@ -42,42 +44,44 @@ namespace MonoTests.System.Xml
 			string xmlNamespace = "http://www.w3.org/XML/1998/namespace";
 
 			// none of them should be null.
-			AssertNotNull (xmlnsPrefix);
-			AssertNotNull (xmlPrefix);
-			AssertNotNull (stringEmpty);
-			AssertNotNull (xmlnsNamespace);
-			AssertNotNull (xmlNamespace);
+			Assertion.AssertNotNull (xmlnsPrefix);
+			Assertion.AssertNotNull (xmlPrefix);
+			Assertion.AssertNotNull (stringEmpty);
+			Assertion.AssertNotNull (xmlnsNamespace);
+			Assertion.AssertNotNull (xmlNamespace);
 
 			// Microsoft's XmlNamespaceManager reports that these three
 			// namespaces aren't declared for some reason.
-			Assert (!namespaceManager.HasNamespace ("xmlns"));
-			Assert (!namespaceManager.HasNamespace ("xml"));
-			Assert (!namespaceManager.HasNamespace (String.Empty));
+			Assertion.Assert (!namespaceManager.HasNamespace ("xmlns"));
+			Assertion.Assert (!namespaceManager.HasNamespace ("xml"));
+			Assertion.Assert (!namespaceManager.HasNamespace (String.Empty));
 
 			// these three namespaces are declared by default.
-			AssertEquals ("http://www.w3.org/2000/xmlns/", namespaceManager.LookupNamespace ("xmlns"));
-			AssertEquals ("http://www.w3.org/XML/1998/namespace", namespaceManager.LookupNamespace ("xml"));
-			AssertEquals (String.Empty, namespaceManager.LookupNamespace (String.Empty));
+			Assertion.AssertEquals ("http://www.w3.org/2000/xmlns/", namespaceManager.LookupNamespace ("xmlns"));
+			Assertion.AssertEquals ("http://www.w3.org/XML/1998/namespace", namespaceManager.LookupNamespace ("xml"));
+			Assertion.AssertEquals (String.Empty, namespaceManager.LookupNamespace (String.Empty));
 
 			// the namespaces should be the same references found in the name table.
-			AssertSame (xmlnsNamespace, namespaceManager.LookupNamespace ("xmlns"));
-			AssertSame (xmlNamespace, namespaceManager.LookupNamespace ("xml"));
-			AssertSame (stringEmpty, namespaceManager.LookupNamespace (String.Empty));
+			Assertion.AssertSame (xmlnsNamespace, namespaceManager.LookupNamespace ("xmlns"));
+			Assertion.AssertSame (xmlNamespace, namespaceManager.LookupNamespace ("xml"));
+			Assertion.AssertSame (stringEmpty, namespaceManager.LookupNamespace (String.Empty));
 
 			// looking up undeclared namespaces should return null.
-			AssertNull (namespaceManager.LookupNamespace ("foo"));
+			Assertion.AssertNull (namespaceManager.LookupNamespace ("foo"));
 		}
 
-		public void TestAddNamespace ()
+		[Test]
+		public void AddNamespace ()
 		{
 			// add a new namespace.
 			namespaceManager.AddNamespace ("foo", "http://foo/");
 			// make sure the new namespace is there.
-			Assert (namespaceManager.HasNamespace ("foo"));
-			AssertEquals ("http://foo/", namespaceManager.LookupNamespace ("foo"));
+			Assertion.Assert (namespaceManager.HasNamespace ("foo"));
+			Assertion.AssertEquals ("http://foo/", namespaceManager.LookupNamespace ("foo"));
 		}
 
-		public void TestAddNamespaceWithNameTable ()
+		[Test]
+		public void AddNamespaceWithNameTable ()
 		{
 			// add a known reference to the name table.
 			string fooNamespace = "http://foo/";
@@ -88,54 +92,57 @@ namespace MonoTests.System.Xml
 			fooNamespace2 += "foo/";
 
 			// the references must be different in order for this test to prove anything.
-			Assert (!Object.ReferenceEquals (fooNamespace, fooNamespace2));
+			Assertion.Assert (!Object.ReferenceEquals (fooNamespace, fooNamespace2));
 
 			// add the namespace with the reference that's not in the name table.
 			namespaceManager.AddNamespace ("foo", fooNamespace2);
 
 			// the returned reference should be the same one that's in the name table.
-			AssertSame (fooNamespace, namespaceManager.LookupNamespace ("foo"));
+			Assertion.AssertSame (fooNamespace, namespaceManager.LookupNamespace ("foo"));
 		}
 
-		public void TestPushScope ()
+		[Test]
+		public void PushScope ()
 		{
 			// add a new namespace.
 			namespaceManager.AddNamespace ("foo", "http://foo/");
 			// make sure the new namespace is there.
-			Assert (namespaceManager.HasNamespace ("foo"));
-			AssertEquals ("http://foo/", namespaceManager.LookupNamespace ("foo"));
+			Assertion.Assert (namespaceManager.HasNamespace ("foo"));
+			Assertion.AssertEquals ("http://foo/", namespaceManager.LookupNamespace ("foo"));
 			// push a new scope.
 			namespaceManager.PushScope ();
 			// add a new namespace.
 			namespaceManager.AddNamespace ("bar", "http://bar/");
 			// make sure the old namespace is not in this new scope.
-			Assert (!namespaceManager.HasNamespace ("foo"));
+			Assertion.Assert (!namespaceManager.HasNamespace ("foo"));
 			// but we're still supposed to be able to lookup the old namespace.
-			AssertEquals ("http://foo/", namespaceManager.LookupNamespace ("foo"));
+			Assertion.AssertEquals ("http://foo/", namespaceManager.LookupNamespace ("foo"));
 			// make sure the new namespace is there.
-			Assert (namespaceManager.HasNamespace ("bar"));
-			AssertEquals ("http://bar/", namespaceManager.LookupNamespace ("bar"));
+			Assertion.Assert (namespaceManager.HasNamespace ("bar"));
+			Assertion.AssertEquals ("http://bar/", namespaceManager.LookupNamespace ("bar"));
 		}
 
-		public void TestPopScope ()
+		[Test]
+		public void PopScope ()
 		{
 			// add some namespaces and a scope.
-			TestPushScope ();
+			PushScope ();
 			// pop the scope.
-			Assert (namespaceManager.PopScope ());
+			Assertion.Assert (namespaceManager.PopScope ());
 			// make sure the first namespace is still there.
-			Assert (namespaceManager.HasNamespace ("foo"));
-			AssertEquals ("http://foo/", namespaceManager.LookupNamespace ("foo"));
+			Assertion.Assert (namespaceManager.HasNamespace ("foo"));
+			Assertion.AssertEquals ("http://foo/", namespaceManager.LookupNamespace ("foo"));
 			// make sure the second namespace is no longer there.
-			Assert (!namespaceManager.HasNamespace ("bar"));
-			AssertNull (namespaceManager.LookupNamespace ("bar"));
+			Assertion.Assert (!namespaceManager.HasNamespace ("bar"));
+			Assertion.AssertNull (namespaceManager.LookupNamespace ("bar"));
 			// make sure there are no more scopes to pop.
-			Assert (!namespaceManager.PopScope ());
+			Assertion.Assert (!namespaceManager.PopScope ());
 			// make sure that popping again doesn't cause an exception.
-			Assert (!namespaceManager.PopScope ());
+			Assertion.Assert (!namespaceManager.PopScope ());
 		}
 
-		public void TestLookupPrefix ()
+		[Test]
+		public void LookupPrefix ()
 		{
 			// This test should use an empty nametable.
 			XmlNamespaceManager nsmgr =
@@ -143,8 +150,8 @@ namespace MonoTests.System.Xml
 			nsmgr.NameTable.Add ("urn:hoge");
 			nsmgr.NameTable.Add ("urn:fuga");
 			nsmgr.AddNamespace (string.Empty, "urn:hoge");
-			AssertNull (nsmgr.LookupPrefix ("urn:fuga"));
-			AssertEquals (String.Empty, nsmgr.LookupPrefix ("urn:hoge"));
+			Assertion.AssertNull (nsmgr.LookupPrefix ("urn:fuga"));
+			Assertion.AssertEquals (String.Empty, nsmgr.LookupPrefix ("urn:hoge"));
 		}
 	}
 }

+ 72 - 57
mcs/class/System.XML/Test/XmlNodeListTests.cs

@@ -1,10 +1,12 @@
 //
 // System.Xml.XmlTextWriterTests
 //
-// Author:
+// Authors:
 //   Kral Ferch <[email protected]>
+//   Martin Willemoes Hansen <[email protected]>
 //
 // (C) 2002 Kral Ferch
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -15,11 +17,9 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlNodeListTests : TestCase
+	[TestFixture]
+	public class XmlNodeListTests
 	{
-		public XmlNodeListTests () : base ("MonoTests.System.Xml.XmlNodeListTests testsuite") {}
-		public XmlNodeListTests (string name) : base (name) {}
-		
 		XmlDocument document;
 		XmlElement documentElement;
 		XmlElement element;
@@ -27,143 +27,155 @@ namespace MonoTests.System.Xml
 		Object obj;
 		IEnumerator enumerator;
 		int index;
-		
-		protected override void SetUp ()
+
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 		}
 
-		public void TestNodeTypesThatCantHaveChildren ()
+		[Test]
+		public void NodeTypesThatCantHaveChildren ()
 		{
 			document.LoadXml ("<foo>bar</foo>");
 			documentElement = document.DocumentElement;
 			node = documentElement.FirstChild;
-			AssertEquals ("Expected a text node.", node.NodeType, XmlNodeType.Text);
-			AssertEquals ("Shouldn't have children.", node.HasChildNodes, false);
-			AssertEquals ("Should be empty node list.", node.ChildNodes.Count, 0);
-			AssertEquals ("Should be empty node list.", node.GetEnumerator().MoveNext(), false);
+			Assertion.AssertEquals ("Expected a text node.", node.NodeType, XmlNodeType.Text);
+			Assertion.AssertEquals ("Shouldn't have children.", node.HasChildNodes, false);
+			Assertion.AssertEquals ("Should be empty node list.", node.ChildNodes.Count, 0);
+			Assertion.AssertEquals ("Should be empty node list.", node.GetEnumerator().MoveNext(), false);
 		}
 
-		public void TestZeroChildren ()
+		[Test]
+		public void ZeroChildren ()
 		{
 			document.LoadXml ("<foo/>");
 			documentElement = document.DocumentElement;
-			AssertEquals ("Should be empty node list.", documentElement.GetEnumerator().MoveNext(), false);
+			Assertion.AssertEquals ("Should be empty node list.", documentElement.GetEnumerator().MoveNext(), false);
 		}
 
-		public void TestOneChild ()
+		[Test]
+		public void OneChild ()
 		{
 			document.LoadXml ("<foo><child1/></foo>");
 			documentElement = document.DocumentElement;
-			AssertEquals ("Incorrect number of children returned from Count property.", documentElement.ChildNodes.Count, 1);
+			Assertion.AssertEquals ("Incorrect number of children returned from Count property.", documentElement.ChildNodes.Count, 1);
 			index = 1;
 			foreach (XmlNode childNode in documentElement.ChildNodes) 
 			{
-				AssertEquals ("Enumerator didn't return correct node.", "child" + index.ToString(), childNode.LocalName);
+				Assertion.AssertEquals ("Enumerator didn't return correct node.", "child" + index.ToString(), childNode.LocalName);
 				index++;
 			}
-			AssertEquals ("foreach didn't loop over all children correctly.", index, 2);
+			Assertion.AssertEquals ("foreach didn't loop over all children correctly.", index, 2);
 		}
 
-		public void TestMultipleChildren ()
+		[Test]
+		public void MultipleChildren ()
 		{
 			document.LoadXml ("<foo><child1/><child2/><child3/></foo>");
 			element = document.DocumentElement;
-			AssertEquals ("Incorrect number of children returned from Count property.", element.ChildNodes.Count, 3);
-			AssertNull ("Index less than zero should have returned null.", element.ChildNodes [-1]);
-			AssertNull ("Index greater than or equal to Count should have returned null.", element.ChildNodes [3]);
-			AssertEquals ("Didn't return the correct child.", element.FirstChild, element.ChildNodes[0]);
-			AssertEquals ("Didn't return the correct child.", "child1", element.ChildNodes[0].LocalName);
-			AssertEquals ("Didn't return the correct child.", "child2", element.ChildNodes[1].LocalName);
-			AssertEquals ("Didn't return the correct child.", "child3", element.ChildNodes[2].LocalName);
+			Assertion.AssertEquals ("Incorrect number of children returned from Count property.", element.ChildNodes.Count, 3);
+			Assertion.AssertNull ("Index less than zero should have returned null.", element.ChildNodes [-1]);
+			Assertion.AssertNull ("Index greater than or equal to Count should have returned null.", element.ChildNodes [3]);
+			Assertion.AssertEquals ("Didn't return the correct child.", element.FirstChild, element.ChildNodes[0]);
+			Assertion.AssertEquals ("Didn't return the correct child.", "child1", element.ChildNodes[0].LocalName);
+			Assertion.AssertEquals ("Didn't return the correct child.", "child2", element.ChildNodes[1].LocalName);
+			Assertion.AssertEquals ("Didn't return the correct child.", "child3", element.ChildNodes[2].LocalName);
 
 			index = 1;
 			foreach (XmlNode childNode in element.ChildNodes) 
 			{
-				AssertEquals ("Enumerator didn't return correct node.", "child" + index.ToString(), childNode.LocalName);
+				Assertion.AssertEquals ("Enumerator didn't return correct node.", "child" + index.ToString(), childNode.LocalName);
 				index++;
 			}
-			AssertEquals ("foreach didn't loop over all children correctly.", index, 4);
+			Assertion.AssertEquals ("foreach didn't loop over all children correctly.", index, 4);
 		}
 
-		public void TestAppendChildAffectOnEnumeration ()
+		[Test]
+		public void AppendChildAffectOnEnumeration ()
 		{
 			document.LoadXml ("<foo><child1/></foo>");
 			element = document.DocumentElement;
 			enumerator = element.GetEnumerator();
-			AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
-			AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
+			Assertion.AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
+			Assertion.AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
 			enumerator.Reset();
-			AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
+			Assertion.AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
 			element.AppendChild(document.CreateElement("child2"));
-			AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
-			AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
+			Assertion.AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
+			Assertion.AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
 		}
 
-		public void TestRemoveChildAffectOnEnumeration ()
+		[Test]
+		public void RemoveChildAffectOnEnumeration ()
 		{
 			document.LoadXml ("<foo><child1/><child2/></foo>");
 			element = document.DocumentElement;
 			enumerator = element.GetEnumerator();
 			element.RemoveChild(element.FirstChild);
 			enumerator.MoveNext();
-			AssertEquals ("Expected child2 element.", ((XmlElement)enumerator.Current).LocalName, "child2");
+			Assertion.AssertEquals ("Expected child2 element.", ((XmlElement)enumerator.Current).LocalName, "child2");
 		}
 
-		public void TestRemoveChildAffectOnEnumerationWhenEnumeratorIsOnRemovedChild ()
+		[Test]
+		public void RemoveChildAffectOnEnumerationWhenEnumeratorIsOnRemovedChild ()
 		{
 			document.LoadXml ("<foo><child1/><child2/><child3/></foo>");
 			element = document.DocumentElement;
 			enumerator = element.GetEnumerator ();
 			enumerator.MoveNext ();
 			enumerator.MoveNext ();
-			AssertEquals ("Expected child2 element.", "child2", ((XmlElement)enumerator.Current).LocalName);
-			AssertEquals ("Expected child2 element.", "child2", element.FirstChild.NextSibling.LocalName);
+			Assertion.AssertEquals ("Expected child2 element.", "child2", ((XmlElement)enumerator.Current).LocalName);
+			Assertion.AssertEquals ("Expected child2 element.", "child2", element.FirstChild.NextSibling.LocalName);
 			element.RemoveChild (element.FirstChild.NextSibling);
 			enumerator.MoveNext ();
 			
 			try {
 				element = (XmlElement) enumerator.Current;
-				Fail ("Expected an InvalidOperationException.");
+				Assertion.Fail ("Expected an InvalidOperationException.");
 			} catch (InvalidOperationException) { }
 		}
 
 		// TODO:  Take the word save off front of this method when XmlNode.ReplaceChild() is implemented.
+
 		public void saveTestReplaceChildAffectOnEnumeration ()
 		{
 			document.LoadXml ("<foo><child1/><child2/></foo>");
 			element = document.DocumentElement;
 			node = document.CreateElement("child3");
 			enumerator = element.GetEnumerator();
-			AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
+			Assertion.AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
 			element.ReplaceChild(node, element.LastChild);
 			enumerator.MoveNext();
-			AssertEquals ("Expected child3 element.", ((XmlElement)enumerator.Current).LocalName, "child3");
-			AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
+			Assertion.AssertEquals ("Expected child3 element.", ((XmlElement)enumerator.Current).LocalName, "child3");
+			Assertion.AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
 		}
 
-		public void TestRemoveOnlyChildAffectOnEnumeration ()
+		[Test]
+		public void RemoveOnlyChildAffectOnEnumeration ()
 		{
 			document.LoadXml ("<foo><child1/></foo>");
 			element = document.DocumentElement;
 			enumerator = element.GetEnumerator();
 			element.RemoveChild(element.FirstChild);
-			AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
+			Assertion.AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
 		}
 
 		// TODO:  Take the word save off front of this method when XmlNode.RemoveAll() is fully implemented.
+
 		public void saveTestRemoveAllAffectOnEnumeration ()
 		{
 			document.LoadXml ("<foo><child1/><child2/><child3/></foo>");
 			element = document.DocumentElement;
 			enumerator = element.GetEnumerator();
-			AssertEquals ("Expected 3 children.", element.ChildNodes.Count, 3);
-			AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
+			Assertion.AssertEquals ("Expected 3 children.", element.ChildNodes.Count, 3);
+			Assertion.AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
 			element.RemoveAll();
-			AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
+			Assertion.AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
 		}
 
-		public void TestCurrentBeforeFirstNode ()
+		[Test]
+		public void CurrentBeforeFirstNode ()
 		{
 			document.LoadXml ("<foo><child1/></foo>");
 			element = document.DocumentElement;
@@ -171,11 +183,12 @@ namespace MonoTests.System.Xml
 			try 
 			{
 				obj = enumerator.Current;
-				Fail ("Calling Current property before first node in list should have thrown InvalidOperationException.");
+				Assertion.Fail ("Calling Current property before first node in list should have thrown InvalidOperationException.");
 			} catch (InvalidOperationException) { }
 		}
 
-		public void TestCurrentAfterLastNode ()
+		[Test]
+		public void CurrentAfterLastNode ()
 		{
 			document.LoadXml ("<foo><child1/></foo>");
 			element = document.DocumentElement;
@@ -185,31 +198,33 @@ namespace MonoTests.System.Xml
 			try 
 			{
 				obj = enumerator.Current;
-				Fail ("Calling Current property after last node in list should have thrown InvalidOperationException.");
+				Assertion.Fail ("Calling Current property after last node in list should have thrown InvalidOperationException.");
 			} 
 			catch (InvalidOperationException) { }
 		}
 
-		public void TestCurrentDoesntMove ()
+		[Test]
+		public void CurrentDoesntMove ()
 		{
 			document.LoadXml ("<foo><child1/></foo>");
 			element = document.DocumentElement;
 			enumerator = element.GetEnumerator();
 			enumerator.MoveNext();
-			AssertEquals("Consecutive calls to Current property should yield same reference.", Object.ReferenceEquals(enumerator.Current, enumerator.Current), true);
+			Assertion.AssertEquals("Consecutive calls to Current property should yield same reference.", Object.ReferenceEquals(enumerator.Current, enumerator.Current), true);
 		}
 
-		public void TestReset ()
+		[Test]
+		public void Reset ()
 		{
 			document.LoadXml ("<foo><child1/><child2/></foo>");
 			element = document.DocumentElement;
 			enumerator = element.GetEnumerator();
 			enumerator.MoveNext();
 			enumerator.MoveNext();
-			AssertEquals("Expected child2.", ((XmlElement)enumerator.Current).LocalName, "child2");
+			Assertion.AssertEquals("Expected child2.", ((XmlElement)enumerator.Current).LocalName, "child2");
 			enumerator.Reset();
 			enumerator.MoveNext();
-			AssertEquals("Expected child1.", ((XmlElement)enumerator.Current).LocalName, "child1");
+			Assertion.AssertEquals("Expected child1.", ((XmlElement)enumerator.Current).LocalName, "child1");
 		}
 	}
 }

+ 62 - 57
mcs/class/System.XML/Test/XmlNodeReaderTests.cs

@@ -1,15 +1,15 @@
 //
 // System.Xml.XmlNodeReaderTests
 //
-// Author:
+// Authors:
 //   Atsushi Enomoto <[email protected]>
+//   Martin Willemoes Hansen <[email protected]>
 //
 // (C) 2003 Atsushi Enomoto
+// (C) 2003 Martin Willemoes Hansen
 //
 //
 
-
-
 using System;
 using System.IO;
 using System.Text;
@@ -19,12 +19,11 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlNodeReaderTests : TestCase
+	[TestFixture]
+	public class XmlNodeReaderTests
 	{
-		public XmlNodeReaderTests () : base ("MonoTests.System.Xml.NodeReaderTests testsuite") {}
-		public XmlNodeReaderTests (string name) : base (name) {}
-
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			document.LoadXml ("<root attr1='value1'><child /></root>");
 		}
@@ -34,105 +33,111 @@ namespace MonoTests.System.Xml
 		// MS.NET's not-overriden XmlNodeReader.WriteStartElement(name)
 		// invokes WriteStartElement(null, name, null). 
 		// WriteStartElement(name, ns) invokes (null, name, ns), too.
-		public void TestInitialState ()
+		[Test]
+		public void InitialState ()
 		{
 			XmlNodeReader nrdr = new XmlNodeReader (document);
-			AssertEquals ("Depth", 0, nrdr.Depth);
-			AssertEquals ("EOF", false, nrdr.EOF);
-			AssertEquals ("HasValue", false, nrdr.HasValue);
-			AssertEquals ("IsEmptyElement", false, nrdr.IsEmptyElement);
-			AssertEquals ("LocalName", String.Empty, nrdr.LocalName);
-			AssertEquals ("NodeType", XmlNodeType.None, nrdr.NodeType);
-			AssertEquals ("ReadState", ReadState.Initial, nrdr.ReadState);
+			Assertion.AssertEquals ("Depth", 0, nrdr.Depth);
+			Assertion.AssertEquals ("EOF", false, nrdr.EOF);
+			Assertion.AssertEquals ("HasValue", false, nrdr.HasValue);
+			Assertion.AssertEquals ("IsEmptyElement", false, nrdr.IsEmptyElement);
+			Assertion.AssertEquals ("LocalName", String.Empty, nrdr.LocalName);
+			Assertion.AssertEquals ("NodeType", XmlNodeType.None, nrdr.NodeType);
+			Assertion.AssertEquals ("ReadState", ReadState.Initial, nrdr.ReadState);
 		}
 
-		public void TestInvalidConstruction ()
+		[Test]
+		public void InvalidConstruction ()
 		{
 			XmlNodeReader nrdr;
 			try {
 				nrdr = new XmlNodeReader (null);
-				Fail ("null reference exception is preferable.");
+				Assertion.Fail ("null reference exception is preferable.");
 			} catch (NullReferenceException ex) {
 			}
 			nrdr = new XmlNodeReader (new XmlDocument ());
 			nrdr.Read ();
-			AssertEquals ("newDoc.ReadState", ReadState.Error, nrdr.ReadState);
-			AssertEquals ("newDoc.EOF", true, nrdr.EOF);
-			AssertEquals ("newDoc.NodeType", XmlNodeType.None, nrdr.NodeType);
+			Assertion.AssertEquals ("newDoc.ReadState", ReadState.Error, nrdr.ReadState);
+			Assertion.AssertEquals ("newDoc.EOF", true, nrdr.EOF);
+			Assertion.AssertEquals ("newDoc.NodeType", XmlNodeType.None, nrdr.NodeType);
 			nrdr = new XmlNodeReader (document.CreateDocumentFragment ());
 			nrdr.Read ();
-			AssertEquals ("Fragment.ReadState", ReadState.Error, nrdr.ReadState);
-			AssertEquals ("Fragment.EOF", true, nrdr.EOF);
-			AssertEquals ("Fragment.NodeType", XmlNodeType.None, nrdr.NodeType);
+			Assertion.AssertEquals ("Fragment.ReadState", ReadState.Error, nrdr.ReadState);
+			Assertion.AssertEquals ("Fragment.EOF", true, nrdr.EOF);
+			Assertion.AssertEquals ("Fragment.NodeType", XmlNodeType.None, nrdr.NodeType);
 		}
 
-		public void TestRead ()
+		[Test]
+		public void Read ()
 		{
 			XmlNodeReader nrdr = new XmlNodeReader (document);
 			nrdr.Read ();
-			AssertEquals ("<root>.NodeType", XmlNodeType.Element, nrdr.NodeType);
-			AssertEquals ("<root>.Name", "root", nrdr.Name);
-			AssertEquals ("<root>.ReadState", ReadState.Interactive, nrdr.ReadState);
-			AssertEquals ("<root>.Depth", 0, nrdr.Depth);
+			Assertion.AssertEquals ("<root>.NodeType", XmlNodeType.Element, nrdr.NodeType);
+			Assertion.AssertEquals ("<root>.Name", "root", nrdr.Name);
+			Assertion.AssertEquals ("<root>.ReadState", ReadState.Interactive, nrdr.ReadState);
+			Assertion.AssertEquals ("<root>.Depth", 0, nrdr.Depth);
 
 			// move to 'child'
 			nrdr.Read ();
-			AssertEquals ("<child/>.Depth", 1, nrdr.Depth);
-			AssertEquals ("<child/>.NodeType", XmlNodeType.Element, nrdr.NodeType);
-			AssertEquals ("<child/>.Name", "child", nrdr.Name);
+			Assertion.AssertEquals ("<child/>.Depth", 1, nrdr.Depth);
+			Assertion.AssertEquals ("<child/>.NodeType", XmlNodeType.Element, nrdr.NodeType);
+			Assertion.AssertEquals ("<child/>.Name", "child", nrdr.Name);
 
 			nrdr.Read ();
-			AssertEquals ("</root>.Depth", 0, nrdr.Depth);
-			AssertEquals ("</root>.NodeType", XmlNodeType.EndElement, nrdr.NodeType);
-			AssertEquals ("</root>.Name", "root", nrdr.Name);
+			Assertion.AssertEquals ("</root>.Depth", 0, nrdr.Depth);
+			Assertion.AssertEquals ("</root>.NodeType", XmlNodeType.EndElement, nrdr.NodeType);
+			Assertion.AssertEquals ("</root>.Name", "root", nrdr.Name);
 
 			nrdr.Read ();
-			AssertEquals ("end.EOF", true, nrdr.EOF);
-			AssertEquals ("end.NodeType", XmlNodeType.None, nrdr.NodeType);
+			Assertion.AssertEquals ("end.EOF", true, nrdr.EOF);
+			Assertion.AssertEquals ("end.NodeType", XmlNodeType.None, nrdr.NodeType);
 		}
 
-		public void TestReadFromElement ()
+		[Test]
+		public void ReadFromElement ()
 		{
 			XmlNodeReader nrdr = new XmlNodeReader (document.DocumentElement);
 			nrdr.Read ();
-			AssertEquals ("<root>.NodeType", XmlNodeType.Element, nrdr.NodeType);
-			AssertEquals ("<root>.Name", "root", nrdr.Name);
-			AssertEquals ("<root>.ReadState", ReadState.Interactive, nrdr.ReadState);
-			AssertEquals ("<root>.Depth", 0, nrdr.Depth);
+			Assertion.AssertEquals ("<root>.NodeType", XmlNodeType.Element, nrdr.NodeType);
+			Assertion.AssertEquals ("<root>.Name", "root", nrdr.Name);
+			Assertion.AssertEquals ("<root>.ReadState", ReadState.Interactive, nrdr.ReadState);
+			Assertion.AssertEquals ("<root>.Depth", 0, nrdr.Depth);
 		}
 
-		public void TestReadString ()
+		[Test]
+		public void ReadString ()
 		{
 			XmlDocument doc = new XmlDocument ();
 			doc.LoadXml ("<root>test of <b>mixed</b> string.<![CDATA[ cdata string.]]></root>");
 			XmlNodeReader nrdr = new XmlNodeReader (doc);
 			nrdr.Read ();
 			string s = nrdr.ReadString ();
-			AssertEquals ("readString.1.ret_val", "test of ", s);
-			AssertEquals ("readString.1.Name", "b", nrdr.Name);
+			Assertion.AssertEquals ("readString.1.ret_val", "test of ", s);
+			Assertion.AssertEquals ("readString.1.Name", "b", nrdr.Name);
 			s = nrdr.ReadString ();
-			AssertEquals ("readString.2.ret_val", "mixed", s);
-			AssertEquals ("readString.2.NodeType", XmlNodeType.EndElement, nrdr.NodeType);
+			Assertion.AssertEquals ("readString.2.ret_val", "mixed", s);
+			Assertion.AssertEquals ("readString.2.NodeType", XmlNodeType.EndElement, nrdr.NodeType);
 			s = nrdr.ReadString ();	// never proceeds.
-			AssertEquals ("readString.3.ret_val", String.Empty, s);
-			AssertEquals ("readString.3.NodeType", XmlNodeType.EndElement, nrdr.NodeType);
+			Assertion.AssertEquals ("readString.3.ret_val", String.Empty, s);
+			Assertion.AssertEquals ("readString.3.NodeType", XmlNodeType.EndElement, nrdr.NodeType);
 			nrdr.Read ();
-			AssertEquals ("readString.4.NodeType", XmlNodeType.Text, nrdr.NodeType);
-			AssertEquals ("readString.4.Value", " string.", nrdr.Value);
+			Assertion.AssertEquals ("readString.4.NodeType", XmlNodeType.Text, nrdr.NodeType);
+			Assertion.AssertEquals ("readString.4.Value", " string.", nrdr.Value);
 			s = nrdr.ReadString ();	// reads the same Text node.
-			AssertEquals ("readString.5.ret_val", " string. cdata string.", s);
-			AssertEquals ("readString.5.NodeType", XmlNodeType.EndElement, nrdr.NodeType);
+			Assertion.AssertEquals ("readString.5.ret_val", " string. cdata string.", s);
+			Assertion.AssertEquals ("readString.5.NodeType", XmlNodeType.EndElement, nrdr.NodeType);
 		}
 
-		public void TestRedInnerXml ()
+		[Test]
+		public void RedInnerXml ()
 		{
 			XmlDocument doc = new XmlDocument ();
 			doc.LoadXml ("<root>test of <b>mixed</b> string.</root>");
 			XmlNodeReader nrdr = new XmlNodeReader (doc);
 			nrdr.ReadInnerXml ();
-			AssertEquals ("initial.ReadState", ReadState.Error, nrdr.ReadState);
-			AssertEquals ("initial.EOF", true, nrdr.EOF);
-			AssertEquals ("initial.NodeType", XmlNodeType.None, nrdr.NodeType);
+			Assertion.AssertEquals ("initial.ReadState", ReadState.Error, nrdr.ReadState);
+			Assertion.AssertEquals ("initial.EOF", true, nrdr.EOF);
+			Assertion.AssertEquals ("initial.NodeType", XmlNodeType.None, nrdr.NodeType);
 		}
 	}
 

+ 50 - 42
mcs/class/System.XML/Test/XmlNodeTests.cs

@@ -1,10 +1,12 @@
 //
 // System.Xml.XmlNodeTests
 //
-// Author:
+// Authors:
 //   Kral Ferch <[email protected]>
+//   Martin Willemoes Hansen
 //
 // (C) 2002 Kral Ferch
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -16,11 +18,9 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlNodeTests : TestCase
+	[TestFixture]
+	public class XmlNodeTests
 	{
-		public XmlNodeTests () : base ("MonoTests.System.Xml.XmlNodeTests testsuite") {}
-		public XmlNodeTests (string name) : base (name) {}
-
 		XmlDocument document;
 		XmlElement element;
 		XmlElement element2;
@@ -31,7 +31,8 @@ namespace MonoTests.System.Xml
 		bool removed;
 		bool removing;
 
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 			document.NodeInserted += new XmlNodeChangedEventHandler (this.EventNodeInserted);
@@ -72,93 +73,97 @@ namespace MonoTests.System.Xml
 			removing = true;
 		}
 
-		public void TestAppendChild ()
+		[Test]
+		public void AppendChild ()
 		{
 			XmlComment comment;
 
 			inserted = false;
 			inserting = false;
 			element.AppendChild (element2);
-			Assert (inserted);
-			Assert (inserting);
+			Assertion.Assert (inserted);
+			Assertion.Assert (inserting);
 
 			// Can only append to elements, documents, and attributes
 			try 
 			{
 				comment = document.CreateComment ("baz");
 				comment.AppendChild (element2);
-				Fail ("Expected an InvalidOperationException to be thrown.");
+				Assertion.Fail ("Expected an InvalidOperationException to be thrown.");
 			} 
 			catch (InvalidOperationException) {}
 
 			// Can't append a node from one document into another document.
 			XmlDocument document2 = new XmlDocument();
-			AssertEquals (1, element.ChildNodes.Count);
+			Assertion.AssertEquals (1, element.ChildNodes.Count);
 			try 
 			{
 				element2 = document2.CreateElement ("qux");
 				element.AppendChild (element2);
-				Fail ("Expected an ArgumentException to be thrown.");
+				Assertion.Fail ("Expected an ArgumentException to be thrown.");
 			} 
 			catch (ArgumentException) {}
-			AssertEquals (1, element.ChildNodes.Count);
+			Assertion.AssertEquals (1, element.ChildNodes.Count);
 
 			// Can't append to a readonly node.
 /* TODO put this in when I figure out how to create a read-only node.
 			try 
 			{
 				XmlElement element3 = (XmlElement)element.CloneNode (false);
-				Assert (!element.IsReadOnly);
-				Assert (element3.IsReadOnly);
+				Assertion.Assert (!element.IsReadOnly);
+				Assertion.Assert (element3.IsReadOnly);
 				element2 = document.CreateElement ("quux");
 				element3.AppendChild (element2);
-				Fail ("Expected an ArgumentException to be thrown.");
+				Assertion.Fail ("Expected an ArgumentException to be thrown.");
 			} 
 			catch (ArgumentException) {}
 */
 		}
 
-		public void TestInsertBefore()
+		[Test]
+		public void InsertBefore()
 		{
 			document = new XmlDocument();
 			document.LoadXml("<root><sub /></root>");
 			XmlElement docelem = document.DocumentElement;
 			docelem.InsertBefore(document.CreateElement("good_child"), docelem.FirstChild);
-			AssertEquals("InsertBefore.Normal", "good_child", docelem.FirstChild.Name);
+			Assertion.AssertEquals("InsertBefore.Normal", "good_child", docelem.FirstChild.Name);
 			// These are required for .NET 1.0 but not for .NET 1.1.
 //			try {
 //				document.InsertBefore (document.CreateElement ("BAD_MAN"), docelem);
-//				Fail ("#InsertBefore.BadPositionButNoError.1");
+//				Assertion.Fail ("#InsertBefore.BadPositionButNoError.1");
 //			}
 //			catch (XmlException) {}
 		}
 
-		public void TestInsertAfter()
+		[Test]
+		public void InsertAfter()
 		{
 			document = new XmlDocument();
 			document.LoadXml("<root><sub1 /><sub2 /></root>");
 			XmlElement docelem = document.DocumentElement;
 			XmlElement newelem = document.CreateElement("good_child");
 			docelem.InsertAfter(newelem, docelem.FirstChild);
-			AssertEquals("InsertAfter.Normal", 3, docelem.ChildNodes.Count);
-			AssertEquals("InsertAfter.First", "sub1", docelem.FirstChild.Name);
-			AssertEquals("InsertAfter.Last", "sub2", docelem.LastChild.Name);
-			AssertEquals("InsertAfter.Prev", "good_child", docelem.FirstChild.NextSibling.Name);
-			AssertEquals("InsertAfter.Next", "good_child", docelem.LastChild.PreviousSibling.Name);
+			Assertion.AssertEquals("InsertAfter.Normal", 3, docelem.ChildNodes.Count);
+			Assertion.AssertEquals("InsertAfter.First", "sub1", docelem.FirstChild.Name);
+			Assertion.AssertEquals("InsertAfter.Last", "sub2", docelem.LastChild.Name);
+			Assertion.AssertEquals("InsertAfter.Prev", "good_child", docelem.FirstChild.NextSibling.Name);
+			Assertion.AssertEquals("InsertAfter.Next", "good_child", docelem.LastChild.PreviousSibling.Name);
 			// this doesn't throw an exception
 			document.InsertAfter(document.CreateElement("BAD_MAN"), docelem);
-			AssertEquals("InsertAfter with bad location", 
+			Assertion.AssertEquals("InsertAfter with bad location", 
 				"<root><sub1 /><good_child /><sub2 /></root><BAD_MAN />",
 				document.InnerXml);
 }
 
-		public void TestPrependChild()
+		[Test]
+		public void PrependChild()
 		{
 			document = new XmlDocument();
 			document.LoadXml("<root><sub1 /><sub2 /></root>");
 			XmlElement docelem = document.DocumentElement;
 			docelem.PrependChild(document.CreateElement("prepender"));
-			AssertEquals("PrependChild", "prepender", docelem.FirstChild.Name);
+			Assertion.AssertEquals("PrependChild", "prepender", docelem.FirstChild.Name);
 		}
 
 		public void saveTestRemoveAll ()
@@ -168,31 +173,34 @@ namespace MonoTests.System.Xml
 			removed = false;
 			removing = false;
 			element.RemoveAll ();
-			Assert (removed);
-			Assert (removing);
+			Assertion.Assert (removed);
+			Assertion.Assert (removing);
 		}
 
-		public void TestRemoveChild ()
+		[Test]
+		public void RemoveChild ()
 		{
 			element.AppendChild(element2);
 			removed = false;
 			removing = false;
 			element.RemoveChild (element2);
-			Assert (removed);
-			Assert (removing);
+			Assertion.Assert (removed);
+			Assertion.Assert (removing);
 		}
 		
-		public void TestGetPrefixOfNamespace ()
+		[Test]
+		public void GetPrefixOfNamespace ()
 		{
 			document.LoadXml ("<root><c1 xmlns='urn:foo'><c2 xmlns:foo='urn:foo' xmlns='urn:bar'><c3 xmlns=''/></c2></c1></root>");
-			AssertEquals ("root", String.Empty, document.DocumentElement.GetPrefixOfNamespace ("urn:foo"));
-			AssertEquals ("c1", String.Empty, document.DocumentElement.GetPrefixOfNamespace ("urn:foo"));
-			AssertEquals ("c2", String.Empty, document.DocumentElement.FirstChild.GetPrefixOfNamespace ("urn:foo"));
-			AssertEquals ("c3", "foo", document.DocumentElement.FirstChild.FirstChild.GetPrefixOfNamespace ("urn:foo"));
+			Assertion.AssertEquals ("root", String.Empty, document.DocumentElement.GetPrefixOfNamespace ("urn:foo"));
+			Assertion.AssertEquals ("c1", String.Empty, document.DocumentElement.GetPrefixOfNamespace ("urn:foo"));
+			Assertion.AssertEquals ("c2", String.Empty, document.DocumentElement.FirstChild.GetPrefixOfNamespace ("urn:foo"));
+			Assertion.AssertEquals ("c3", "foo", document.DocumentElement.FirstChild.FirstChild.GetPrefixOfNamespace ("urn:foo"));
 
 		}
 
-		public void TestReplaceChild ()
+		[Test]
+		public void ReplaceChild ()
 		{
 			document.LoadXml ("<root/>");
 			document.NodeInserted += new XmlNodeChangedEventHandler (this.EventNodeInserted);
@@ -201,9 +209,9 @@ namespace MonoTests.System.Xml
 			inserted = changed = removed = false;
 			XmlElement el = document.CreateElement("root2");
 			document.ReplaceChild (el, document.DocumentElement);
-			AssertEquals ("root2", document.DocumentElement.Name);
-			AssertEquals (1, document.ChildNodes.Count);
-			Assert (inserted && removed && !changed);
+			Assertion.AssertEquals ("root2", document.DocumentElement.Name);
+			Assertion.AssertEquals (1, document.ChildNodes.Count);
+			Assertion.Assert (inserted && removed && !changed);
 		}
 	}
 }

+ 11 - 9
mcs/class/System.XML/Test/XmlProcessingInstructionTests.cs

@@ -1,10 +1,12 @@
 //
 // System.Xml.XmlTextWriterTests
 //
-// Author:
+// Authors:
 //   Kral Ferch <[email protected]>
+//   Martin Willemoes Hansen <[email protected]>
 //
 // (C) 2002 Kral Ferch
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -13,24 +15,24 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlProcessingInstructionTests : TestCase
+	[TestFixture]
+	public class XmlProcessingInstructionTests
 	{
-		public XmlProcessingInstructionTests () : base ("MonoTests.System.Xml.XmlProcessingInstructionTests testsuite") {}
-		public XmlProcessingInstructionTests (string name) : base (name) {}
-
 		XmlDocument document;
 		XmlProcessingInstruction pi;
 
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 		}
 
-		public void TestInnerAndOuterXml ()
+		[Test]
+		public void InnerAndOuterXml ()
 		{
 			pi = document.CreateProcessingInstruction ("foo", "bar");
-			AssertEquals (String.Empty, pi.InnerXml);
-			AssertEquals ("<?foo bar?>", pi.OuterXml);
+			Assertion.AssertEquals (String.Empty, pi.InnerXml);
+			Assertion.AssertEquals ("<?foo bar?>", pi.OuterXml);
 		}
 	}
 }

+ 43 - 34
mcs/class/System.XML/Test/XmlSignificantWhitespaceTests.cs

@@ -1,10 +1,12 @@
 //
 // System.Xml.XmlWhitespaceTests.cs
 //
-// Author:
+// Authors:
 //	Duncan Mak  ([email protected])
+//      Martin Willemoes Hansen ([email protected])
 //
 // (C) Ximian, Inc.
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -14,7 +16,8 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlSignificantWhitespaceTests : TestCase
+	[TestFixture]
+	public class XmlSignificantWhitespaceTests
 	{
 		XmlDocument document;
 		XmlDocument doc2;
@@ -24,10 +27,8 @@ namespace MonoTests.System.Xml
 		XmlNode deep;
 		XmlNode shallow;
 		
-		public XmlSignificantWhitespaceTests ()	: base ("MonoTests.System.Xml.XmlWhitespaceTests testsuite") {}
-		public XmlSignificantWhitespaceTests (string name) : base (name) {}
-
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 			document.LoadXml ("<root><foo></foo></root>");
@@ -38,35 +39,38 @@ namespace MonoTests.System.Xml
 			doc2 = new XmlDocument ();
 		}
 
-		public void TestInnerAndOuterXml ()
+		[Test]
+		public void InnerAndOuterXml ()
 		{
 			whitespace = doc2.CreateSignificantWhitespace ("\r\n\t ");
-			AssertEquals (String.Empty, whitespace.InnerXml);
-			AssertEquals ("\r\n\t ", whitespace.OuterXml);
+			Assertion.AssertEquals (String.Empty, whitespace.InnerXml);
+			Assertion.AssertEquals ("\r\n\t ", whitespace.OuterXml);
 		}
 
-		public void TestDataAndValue ()
+		[Test]
+		public void DataAndValue ()
 		{
 			string val = "\t\t\r\n ";
 			whitespace = doc2.CreateSignificantWhitespace (val);
-			AssertEquals ("#DataValue.1", val, whitespace.Data);
-			AssertEquals ("#DataValue.2", val, whitespace.Value);
+			Assertion.AssertEquals ("#DataValue.1", val, whitespace.Data);
+			Assertion.AssertEquals ("#DataValue.2", val, whitespace.Value);
 			whitespace.Value = val + "\t";
-			AssertEquals ("#DataValue.3", val + "\t", whitespace.Data);
+			Assertion.AssertEquals ("#DataValue.3", val + "\t", whitespace.Data);
 		}
 			
-		internal void TestXmlNodeBaseProperties (XmlNode original, XmlNode cloned)
+		internal void XmlNodeBaseProperties (XmlNode original, XmlNode cloned)
 		{
 //			assertequals (original.nodetype + " was incorrectly cloned.",
 //				      original.baseuri, cloned.baseuri);			
-			AssertNull (cloned.ParentNode);
-			AssertEquals ("Value incorrectly cloned",
+			Assertion.AssertNull (cloned.ParentNode);
+			Assertion.AssertEquals ("Value incorrectly cloned",
 				       cloned.Value, original.Value);
 			
-                        Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
+                        Assertion.Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
 		}
 
-		public void TestXmlSignificantWhitespaceBadConstructor ()
+		[Test]
+		public void XmlSignificantWhitespaceBadConstructor ()
 		{
 			try {
 				broken = document.CreateSignificantWhitespace ("black");				
@@ -75,52 +79,57 @@ namespace MonoTests.System.Xml
 				return;
 
 			} catch (Exception) {
-				Fail ("Incorrect Exception thrown.");
+				Assertion.Fail ("Incorrect Exception thrown.");
 			}
 		}
 
-		public void TestXmlSignificantWhitespaceConstructor ()
+		[Test]
+		public void XmlSignificantWhitespaceConstructor ()
 		{
-			AssertEquals ("whitespace char didn't get copied right",
+			Assertion.AssertEquals ("whitespace char didn't get copied right",
 				      "\r\n", whitespace.Data);
 		}
 		
-	       
-		public void TestXmlSignificantWhitespaceName ()
+	       	[Test]
+		public void XmlSignificantWhitespaceName ()
 		{
-			AssertEquals (whitespace.NodeType + " Name property broken",
+			Assertion.AssertEquals (whitespace.NodeType + " Name property broken",
 				      whitespace.Name, "#significant-whitespace");
 		}
 
-		public void TestXmlSignificantWhitespaceLocalName ()
+		[Test]
+		public void XmlSignificantWhitespaceLocalName ()
 		{
-			AssertEquals (whitespace.NodeType + " LocalName property broken",
+			Assertion.AssertEquals (whitespace.NodeType + " LocalName property broken",
 				      whitespace.LocalName, "#significant-whitespace");
 		}
 
-		public void TestXmlSignificantWhitespaceNodeType ()
+		[Test]
+		public void XmlSignificantWhitespaceNodeType ()
 		{
-			AssertEquals ("XmlSignificantWhitespace NodeType property broken",
+			Assertion.AssertEquals ("XmlSignificantWhitespace NodeType property broken",
 				      whitespace.NodeType.ToString (), "SignificantWhitespace");
 		}
 
-		public void TestXmlSignificantWhitespaceIsReadOnly ()
+		[Test]
+		public void XmlSignificantWhitespaceIsReadOnly ()
 		{
-			AssertEquals ("XmlSignificantWhitespace IsReadOnly property broken",
+			Assertion.AssertEquals ("XmlSignificantWhitespace IsReadOnly property broken",
 				      whitespace.IsReadOnly, false);
 		}
 
-		public void TestXmlSignificantWhitespaceCloneNode ()
+		[Test]
+		public void XmlSignificantWhitespaceCloneNode ()
 		{
 			original = whitespace;
 
 			shallow = whitespace.CloneNode (false); // shallow
-			TestXmlNodeBaseProperties (original, shallow);
+			XmlNodeBaseProperties (original, shallow);
 						
 			deep = whitespace.CloneNode (true); // deep
-			TestXmlNodeBaseProperties (original, deep); 
+			XmlNodeBaseProperties (original, deep); 
 
-                        AssertEquals ("deep cloning differs from shallow cloning",
+                        Assertion.AssertEquals ("deep cloning differs from shallow cloning",
 				      deep.OuterXml, shallow.OuterXml);
 		}
 	}

+ 178 - 141
mcs/class/System.XML/Test/XmlTextReaderTests.cs

@@ -1,8 +1,9 @@
 //
 // XmlTextReaderTests.cs
 //
-// Author:
+// Authors:
 //   Jason Diamond ([email protected])
+//   Martin Willemoes Hansen ([email protected])
 //
 // (C) 2001, 2002 Jason Diamond  http://injektilo.org/
 //
@@ -16,17 +17,15 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlTextReaderTests : TestCase
+	[TestFixture]
+	public class XmlTextReaderTests
 	{
-		public XmlTextReaderTests () : base ("MonoTests.System.Xml.XmlTextReaderTests testsuite") { }
-		public XmlTextReaderTests (string name) : base (name) { }
-
 		private void AssertStartDocument (XmlReader xmlReader)
 		{
-			Assert (xmlReader.ReadState == ReadState.Initial);
-			Assert (xmlReader.NodeType == XmlNodeType.None);
-			Assert (xmlReader.Depth == 0);
-			Assert (!xmlReader.EOF);
+			Assertion.Assert (xmlReader.ReadState == ReadState.Initial);
+			Assertion.Assert (xmlReader.NodeType == XmlNodeType.None);
+			Assertion.Assert (xmlReader.Depth == 0);
+			Assertion.Assert (!xmlReader.EOF);
 		}
 
 		private void AssertNode (
@@ -41,9 +40,9 @@ namespace MonoTests.System.Xml
 			string value,
 			int attributeCount)
 		{
-			Assert (xmlReader.Read ());
-			Assert (xmlReader.ReadState == ReadState.Interactive);
-			Assert (!xmlReader.EOF);
+			Assertion.Assert (xmlReader.Read ());
+			Assertion.Assert (xmlReader.ReadState == ReadState.Interactive);
+			Assertion.Assert (!xmlReader.EOF);
 			AssertNodeValues (xmlReader, nodeType, depth, isEmptyElement, name, prefix, localName, namespaceURI, value, attributeCount);
 		}
 
@@ -59,25 +58,25 @@ namespace MonoTests.System.Xml
 			string value,
 			int attributeCount)
 		{
-			AssertEquals ("NodeType", nodeType, xmlReader.NodeType);
-			AssertEquals ("Depth", depth, xmlReader.Depth);
-			AssertEquals ("IsEmptyElement", isEmptyElement, xmlReader.IsEmptyElement);
+			Assertion.AssertEquals ("NodeType", nodeType, xmlReader.NodeType);
+			Assertion.AssertEquals ("Depth", depth, xmlReader.Depth);
+			Assertion.AssertEquals ("IsEmptyElement", isEmptyElement, xmlReader.IsEmptyElement);
 
-			AssertEquals ("name", name, xmlReader.Name);
+			Assertion.AssertEquals ("name", name, xmlReader.Name);
 
-			AssertEquals ("prefix", prefix, xmlReader.Prefix);
+			Assertion.AssertEquals ("prefix", prefix, xmlReader.Prefix);
 
-			AssertEquals ("localName", localName, xmlReader.LocalName);
+			Assertion.AssertEquals ("localName", localName, xmlReader.LocalName);
 
-			AssertEquals ("namespaceURI", namespaceURI, xmlReader.NamespaceURI);
+			Assertion.AssertEquals ("namespaceURI", namespaceURI, xmlReader.NamespaceURI);
 
-			AssertEquals ("hasValue", (value != String.Empty), xmlReader.HasValue);
+			Assertion.AssertEquals ("hasValue", (value != String.Empty), xmlReader.HasValue);
 
-			AssertEquals ("Value", value, xmlReader.Value);
+			Assertion.AssertEquals ("Value", value, xmlReader.Value);
 
-			AssertEquals ("hasAttributes", attributeCount > 0, xmlReader.HasAttributes);
+			Assertion.AssertEquals ("hasAttributes", attributeCount > 0, xmlReader.HasAttributes);
 
-			AssertEquals ("attributeCount", attributeCount, xmlReader.AttributeCount);
+			Assertion.AssertEquals ("attributeCount", attributeCount, xmlReader.AttributeCount);
 		}
 
 		private void AssertAttribute (
@@ -88,29 +87,30 @@ namespace MonoTests.System.Xml
 			string namespaceURI,
 			string value)
 		{
-			AssertEquals ("value", value, xmlReader [name]);
+			Assertion.AssertEquals ("value", value, xmlReader [name]);
 
-			Assert (xmlReader.GetAttribute (name) == value);
+			Assertion.Assert (xmlReader.GetAttribute (name) == value);
 
 			if (namespaceURI != String.Empty) {
-				Assert (xmlReader[localName, namespaceURI] == value);
-				Assert (xmlReader.GetAttribute (localName, namespaceURI) == value);
+				Assertion.Assert (xmlReader[localName, namespaceURI] == value);
+				Assertion.Assert (xmlReader.GetAttribute (localName, namespaceURI) == value);
 			}
 		}
 
 		private void AssertEndDocument (XmlReader xmlReader)
 		{
-			Assert ("could read", !xmlReader.Read ());
-			AssertEquals ("NodeType is not XmlNodeType.None", XmlNodeType.None, xmlReader.NodeType);
-			AssertEquals ("Depth is not 0", 0, xmlReader.Depth);
-			AssertEquals ("ReadState is not ReadState.EndOfFile",  ReadState.EndOfFile, xmlReader.ReadState);
-			Assert ("not EOF", xmlReader.EOF);
+			Assertion.Assert ("could read", !xmlReader.Read ());
+			Assertion.AssertEquals ("NodeType is not XmlNodeType.None", XmlNodeType.None, xmlReader.NodeType);
+			Assertion.AssertEquals ("Depth is not 0", 0, xmlReader.Depth);
+			Assertion.AssertEquals ("ReadState is not ReadState.EndOfFile",  ReadState.EndOfFile, xmlReader.ReadState);
+			Assertion.Assert ("not EOF", xmlReader.EOF);
 
 			xmlReader.Close ();
-			AssertEquals ("ReadState is not ReadState.Cosed", ReadState.Closed, xmlReader.ReadState);
+			Assertion.AssertEquals ("ReadState is not ReadState.Cosed", ReadState.Closed, xmlReader.ReadState);
 		}
 
-		public void TestEmptyElement ()
+		[Test]
+		public void EmptyElement ()
 		{
 			string xml = "<foo/>";
 			XmlReader xmlReader =
@@ -134,7 +134,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestEmptyElementWithBadName ()
+		[Test]
+		public void EmptyElementWithBadName ()
 		{
 			string xml = "<1foo/>";
 			XmlReader xmlReader =
@@ -148,10 +149,11 @@ namespace MonoTests.System.Xml
 				caughtXmlException = true;
 			}
 
-			Assert(caughtXmlException);
+			Assertion.Assert(caughtXmlException);
 		}
 
-		public void TestEmptyElementWithWhitespace ()
+		[Test]
+		public void EmptyElementWithWhitespace ()
 		{
 			string xml = "<foo />";
 			XmlReader xmlReader =
@@ -175,7 +177,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestEmptyElementWithStartAndEndTag ()
+		[Test]
+		public void EmptyElementWithStartAndEndTag ()
 		{
 			string xml = "<foo></foo>";
 			XmlReader xmlReader =
@@ -212,7 +215,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestEmptyElementWithStartAndEndTagWithWhitespace ()
+		[Test]
+		public void EmptyElementWithStartAndEndTagWithWhitespace ()
 		{
 			string xml = "<foo ></foo >";
 			XmlReader xmlReader =
@@ -249,7 +253,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestNestedEmptyTag ()
+		[Test]
+		public void NestedEmptyTag ()
 		{
 			string xml = "<foo><bar/></foo>";
 			XmlReader xmlReader =
@@ -299,7 +304,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestNestedText ()
+		[Test]
+		public void NestedText ()
 		{
 			string xml = "<foo>bar</foo>";
 			XmlReader xmlReader =
@@ -349,7 +355,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestEmptyElementWithAttribute ()
+		[Test]
+		public void EmptyElementWithAttribute ()
 		{
 			string xml = @"<foo bar=""baz""/>";
 			XmlReader xmlReader =
@@ -382,7 +389,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestStartAndEndTagWithAttribute ()
+		[Test]
+		public void StartAndEndTagWithAttribute ()
 		{
 			string xml = @"<foo bar='baz'></foo>";
 			XmlReader xmlReader =
@@ -428,7 +436,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestEmptyElementWithTwoAttributes ()
+		[Test]
+		public void EmptyElementWithTwoAttributes ()
 		{
 			string xml = @"<foo bar=""baz"" quux='quuux'/>";
 			XmlReader xmlReader =
@@ -470,7 +479,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestProcessingInstructionBeforeDocumentElement ()
+		[Test]
+		public void ProcessingInstructionBeforeDocumentElement ()
 		{
 			string xml = "<?foo bar?><baz/>";
 			XmlReader xmlReader =
@@ -507,7 +517,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestCommentBeforeDocumentElement ()
+		[Test]
+		public void CommentBeforeDocumentElement ()
 		{
 			string xml = "<!--foo--><bar/>";
 			XmlReader xmlReader =
@@ -544,7 +555,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestPredefinedEntities ()
+		[Test]
+		public void PredefinedEntities ()
 		{
 			string xml = "<foo>&lt;&gt;&amp;&apos;&quot;</foo>";
 			XmlReader xmlReader =
@@ -594,7 +606,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestEntityReference ()
+		[Test]
+		public void EntityReference ()
 		{
 			string xml = "<foo>&bar;</foo>";
 			XmlReader xmlReader =
@@ -644,7 +657,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestEntityReferenceInsideText ()
+		[Test]
+		public void EntityReferenceInsideText ()
 		{
 			string xml = "<foo>bar&baz;quux</foo>";
 			XmlReader xmlReader =
@@ -720,7 +734,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestCharacterReferences ()
+		[Test]
+		public void CharacterReferences ()
 		{
 			string xml = "<foo>&#70;&#x4F;&#x4f;</foo>";
 			XmlReader xmlReader =
@@ -770,7 +785,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestEntityReferenceInAttribute ()
+		[Test]
+		public void EntityReferenceInAttribute ()
 		{
 			string xml = "<foo bar='&baz;'/>";
 			XmlReader xmlReader =
@@ -803,7 +819,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestPredefinedEntitiesInAttribute ()
+		[Test]
+		public void PredefinedEntitiesInAttribute ()
 		{
 			string xml = "<foo bar='&lt;&gt;&amp;&apos;&quot;'/>";
 			XmlReader xmlReader =
@@ -836,7 +853,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestCharacterReferencesInAttribute ()
+		[Test]
+		public void CharacterReferencesInAttribute ()
 		{
 			string xml = "<foo bar='&#70;&#x4F;&#x4f;'/>";
 			XmlReader xmlReader =
@@ -869,7 +887,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestCDATA ()
+		[Test]
+		public void CDATA ()
 		{
 			string xml = "<foo><![CDATA[<>&]]></foo>";
 			XmlReader xmlReader =
@@ -919,7 +938,8 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestEmptyElementInNamespace ()
+		[Test]
+		public void EmptyElementInNamespace ()
 		{
 			string xml = @"<foo:bar xmlns:foo='http://foo/' />";
 			XmlReader xmlReader =
@@ -949,12 +969,13 @@ namespace MonoTests.System.Xml
 				"http://foo/" // value
 			);
 
-			AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
+			Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
 
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestEmptyElementInDefaultNamespace ()
+		[Test]
+		public void EmptyElementInDefaultNamespace ()
 		{
 			string xml = @"<foo xmlns='http://foo/' />";
 			XmlReader xmlReader =
@@ -984,12 +1005,13 @@ namespace MonoTests.System.Xml
 				"http://foo/" // value
 			);
 
-			AssertEquals ("http://foo/", xmlReader.LookupNamespace (String.Empty));
+			Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace (String.Empty));
 
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestChildElementInNamespace ()
+		[Test]
+		public void ChildElementInNamespace ()
 		{
 			string xml = @"<foo:bar xmlns:foo='http://foo/'><baz:quux xmlns:baz='http://baz/' /></foo:bar>";
 			XmlReader xmlReader =
@@ -1019,7 +1041,7 @@ namespace MonoTests.System.Xml
 				"http://foo/" // value
 			);
 
-			AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
+			Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
 
 			AssertNode (
 				xmlReader, // xmlReader
@@ -1043,8 +1065,8 @@ namespace MonoTests.System.Xml
 				"http://baz/" // value
 			);
 
-			AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
-			AssertEquals ("http://baz/", xmlReader.LookupNamespace ("baz"));
+			Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
+			Assertion.AssertEquals ("http://baz/", xmlReader.LookupNamespace ("baz"));
 
 			AssertNode (
 				xmlReader, // xmlReader
@@ -1059,13 +1081,14 @@ namespace MonoTests.System.Xml
 				0 // attributeCount
 			);
 
-			AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
-			AssertNull (xmlReader.LookupNamespace ("baz"));
+			Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
+			Assertion.AssertNull (xmlReader.LookupNamespace ("baz"));
 
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestChildElementInDefaultNamespace ()
+		[Test]
+		public void ChildElementInDefaultNamespace ()
 		{
 			string xml = @"<foo:bar xmlns:foo='http://foo/'><baz xmlns='http://baz/' /></foo:bar>";
 			XmlReader xmlReader =
@@ -1095,7 +1118,7 @@ namespace MonoTests.System.Xml
 				"http://foo/" // value
 			);
 
-			AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
+			Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
 
 			AssertNode (
 				xmlReader, // xmlReader
@@ -1119,8 +1142,8 @@ namespace MonoTests.System.Xml
 				"http://baz/" // value
 			);
 
-			AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
-			AssertEquals ("http://baz/", xmlReader.LookupNamespace (String.Empty));
+			Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
+			Assertion.AssertEquals ("http://baz/", xmlReader.LookupNamespace (String.Empty));
 
 			AssertNode (
 				xmlReader, // xmlReader
@@ -1135,12 +1158,13 @@ namespace MonoTests.System.Xml
 				0 // attributeCount
 			);
 
-			AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
+			Assertion.AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
 
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestAttributeInNamespace ()
+		[Test]
+		public void AttributeInNamespace ()
 		{
 			string xml = @"<foo bar:baz='quux' xmlns:bar='http://bar/' />";
 			XmlReader xmlReader =
@@ -1179,7 +1203,7 @@ namespace MonoTests.System.Xml
 				"http://bar/" // value
 			);
 
-			AssertEquals ("http://bar/", xmlReader.LookupNamespace ("bar"));
+			Assertion.AssertEquals ("http://bar/", xmlReader.LookupNamespace ("bar"));
 
 			AssertEndDocument (xmlReader);
 		}
@@ -1190,19 +1214,21 @@ namespace MonoTests.System.Xml
 
 #if false
 
-		public void TestIsFirstNameChar ()
+		[Test]
+		public void IsFirstNameCharTest ()
 		{
 			for (int ch = 0; ch <= 0xFFFF; ++ch) {
-				Assert (
+				Assertion.Assert (
 					XmlChar.IsFirstNameChar (ch) ==
 						IsFirstNameChar (ch));
 			}
 		}
 
-		public void TestIsNameChar ()
+		[Test]
+		public void IsNameCharTest ()
 		{
 			for (int ch = 0; ch <= 0xFFFF; ++ch) {
-				Assert (
+				Assertion.Assert (
 					XmlChar.IsNameChar (ch) ==
 						IsNameChar (ch));
 			}
@@ -1588,72 +1614,78 @@ namespace MonoTests.System.Xml
 		}
 
 #endif
-
-		public void TestIsName ()
+		[Test]
+		public void IsName ()
 		{
-			Assert (XmlReader.IsName ("foo"));
-			Assert (!XmlReader.IsName ("1foo"));
-			Assert (!XmlReader.IsName (" foo"));
+			Assertion.Assert (XmlReader.IsName ("foo"));
+			Assertion.Assert (!XmlReader.IsName ("1foo"));
+			Assertion.Assert (!XmlReader.IsName (" foo"));
 		}
 
-		public void TestIsNameToken ()
+		[Test]
+		public void IsNameToken ()
 		{
-			Assert (XmlReader.IsNameToken ("foo"));
-			Assert (XmlReader.IsNameToken ("1foo"));
-			Assert (!XmlReader.IsNameToken (" foo"));
+			Assertion.Assert (XmlReader.IsNameToken ("foo"));
+			Assertion.Assert (XmlReader.IsNameToken ("1foo"));
+			Assertion.Assert (!XmlReader.IsNameToken (" foo"));
 		}
 
-		public void TestMoveToElementFromAttribute ()
+		[Test]
+		public void MoveToElementFromAttribute ()
 		{
 			string xml = @"<foo bar=""baz"" />";
 			XmlReader xmlReader =
 				new XmlTextReader (new StringReader (xml));
 
-			Assert (xmlReader.Read ());
-			AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
-			Assert (xmlReader.MoveToFirstAttribute ());
-			AssertEquals (XmlNodeType.Attribute, xmlReader.NodeType);
-			Assert (xmlReader.MoveToElement ());
-			AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
+			Assertion.Assert (xmlReader.Read ());
+			Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
+			Assertion.Assert (xmlReader.MoveToFirstAttribute ());
+			Assertion.AssertEquals (XmlNodeType.Attribute, xmlReader.NodeType);
+			Assertion.Assert (xmlReader.MoveToElement ());
+			Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
 		}
 
-		public void TestMoveToElementFromElement ()
+		[Test]
+		public void MoveToElementFromElement ()
 		{
 			string xml = @"<foo bar=""baz"" />";
 			XmlReader xmlReader =
 				new XmlTextReader (new StringReader (xml));
 
-			Assert (xmlReader.Read ());
-			AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
-			Assert (!xmlReader.MoveToElement ());
-			AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
+			Assertion.Assert (xmlReader.Read ());
+			Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
+			Assertion.Assert (!xmlReader.MoveToElement ());
+			Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
 		}
 
-		public void TestMoveToFirstAttributeWithNoAttributes ()
+		[Test]
+		public void MoveToFirstAttributeWithNoAttributes ()
 		{
 			string xml = @"<foo />";
 			XmlReader xmlReader =
 				new XmlTextReader (new StringReader (xml));
 
-			Assert (xmlReader.Read ());
-			AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
-			Assert (!xmlReader.MoveToFirstAttribute ());
-			AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
+			Assertion.Assert (xmlReader.Read ());
+			Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
+			Assertion.Assert (!xmlReader.MoveToFirstAttribute ());
+			Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
 		}
 
-		public void TestMoveToNextAttributeWithNoAttributes ()
+		[Test]
+		public void MoveToNextAttributeWithNoAttributes ()
 		{
 			string xml = @"<foo />";
 			XmlReader xmlReader =
 				new XmlTextReader (new StringReader (xml));
 
-			Assert (xmlReader.Read ());
-			AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
-			Assert (!xmlReader.MoveToNextAttribute ());
-			AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
+			Assertion.Assert (xmlReader.Read ());
+			Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
+			Assertion.Assert (!xmlReader.MoveToNextAttribute ());
+			Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
 		}
 
-		public void TestMoveToNextAttribute()
+		[Test]
+		public void MoveToNextAttribute()
 		{
 			string xml = @"<foo bar=""baz"" quux='quuux'/>";
 			XmlReader xmlReader =
@@ -1692,17 +1724,17 @@ namespace MonoTests.System.Xml
 				"quuux" // value
 			);
 
-			Assert (xmlReader.MoveToNextAttribute ());
-			Assert ("bar" == xmlReader.Name || "quux" == xmlReader.Name);
-			Assert ("baz" == xmlReader.Value || "quuux" == xmlReader.Value);
+			Assertion.Assert (xmlReader.MoveToNextAttribute ());
+			Assertion.Assert ("bar" == xmlReader.Name || "quux" == xmlReader.Name);
+			Assertion.Assert ("baz" == xmlReader.Value || "quuux" == xmlReader.Value);
 
-			Assert (xmlReader.MoveToNextAttribute ());
-			Assert ("bar" == xmlReader.Name || "quux" == xmlReader.Name);
-			Assert ("baz" == xmlReader.Value || "quuux" == xmlReader.Value);
+			Assertion.Assert (xmlReader.MoveToNextAttribute ());
+			Assertion.Assert ("bar" == xmlReader.Name || "quux" == xmlReader.Name);
+			Assertion.Assert ("baz" == xmlReader.Value || "quuux" == xmlReader.Value);
 
-			Assert (!xmlReader.MoveToNextAttribute ());
+			Assertion.Assert (!xmlReader.MoveToNextAttribute ());
 
-            Assert (xmlReader.MoveToElement ());
+            Assertion.Assert (xmlReader.MoveToElement ());
 
 			AssertNodeValues (
 				xmlReader, // xmlReader
@@ -1720,26 +1752,28 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestAttributeOrder ()
+		[Test]
+		public void AttributeOrder ()
 		{
 			string xml = @"<foo _1='1' _2='2' _3='3' />";
 			XmlReader xmlReader =
 				new XmlTextReader (new StringReader (xml));
 
-			Assert (xmlReader.Read ());
-			AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
+			Assertion.Assert (xmlReader.Read ());
+			Assertion.AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
 
-			Assert (xmlReader.MoveToFirstAttribute ());
-			AssertEquals ("_1", xmlReader.Name);
-			Assert (xmlReader.MoveToNextAttribute ());
-			AssertEquals ("_2", xmlReader.Name);
-			Assert (xmlReader.MoveToNextAttribute ());
-			AssertEquals ("_3", xmlReader.Name);
+			Assertion.Assert (xmlReader.MoveToFirstAttribute ());
+			Assertion.AssertEquals ("_1", xmlReader.Name);
+			Assertion.Assert (xmlReader.MoveToNextAttribute ());
+			Assertion.AssertEquals ("_2", xmlReader.Name);
+			Assertion.Assert (xmlReader.MoveToNextAttribute ());
+			Assertion.AssertEquals ("_3", xmlReader.Name);
 
-			Assert (!xmlReader.MoveToNextAttribute ());
+			Assertion.Assert (!xmlReader.MoveToNextAttribute ());
 		}
 
-		public void TestFragmentConstructor()
+		[Test]
+		public void FragmentConstructor()
 		{
 			XmlDocument doc = new XmlDocument();
 //			doc.LoadXml("<root/>");
@@ -1764,16 +1798,18 @@ namespace MonoTests.System.Xml
 			AssertEndDocument (xmlReader);
 		}
 
-		public void TestAttributeWithCharacterReference ()
+		[Test]
+		public void AttributeWithCharacterReference ()
 		{
 			string xml = @"<a value='hello &amp; world' />";
 			XmlReader xmlReader =
 				new XmlTextReader (new StringReader (xml));
 			xmlReader.Read ();
-			AssertEquals ("hello & world", xmlReader ["value"]);
+			Assertion.AssertEquals ("hello & world", xmlReader ["value"]);
 		}
 
-		public void TestAttributeWithEntityReference ()
+		[Test]
+		public void AttributeWithEntityReference ()
 		{
 			string xml = @"<a value='hello &ent; world' />";
 			XmlReader xmlReader =
@@ -1781,32 +1817,33 @@ namespace MonoTests.System.Xml
 			xmlReader.Read ();
 			xmlReader.MoveToFirstAttribute ();
 			xmlReader.ReadAttributeValue ();
-			AssertEquals ("hello ", xmlReader.Value);
+			Assertion.AssertEquals ("hello ", xmlReader.Value);
 			xmlReader.ReadAttributeValue ();
-			AssertEquals (XmlNodeType.EntityReference, xmlReader.NodeType);
-			AssertEquals ("ent", xmlReader.Name);
-			AssertEquals (XmlNodeType.EntityReference, xmlReader.NodeType);
+			Assertion.AssertEquals (XmlNodeType.EntityReference, xmlReader.NodeType);
+			Assertion.AssertEquals ("ent", xmlReader.Name);
+			Assertion.AssertEquals (XmlNodeType.EntityReference, xmlReader.NodeType);
 			xmlReader.ReadAttributeValue ();
-			AssertEquals (" world", xmlReader.Value);
-			AssertEquals (XmlNodeType.Text, xmlReader.NodeType);
+			Assertion.AssertEquals (" world", xmlReader.Value);
+			Assertion.AssertEquals (XmlNodeType.Text, xmlReader.NodeType);
 			xmlReader.ReadAttributeValue ();
-			AssertEquals (XmlNodeType.None, xmlReader.NodeType);
+			Assertion.AssertEquals (XmlNodeType.None, xmlReader.NodeType);
 			xmlReader.ReadAttributeValue ();
-			AssertEquals (XmlNodeType.None, xmlReader.NodeType);
+			Assertion.AssertEquals (XmlNodeType.None, xmlReader.NodeType);
 		}
 
-		public void TestQuoteChar ()
+		[Test]
+		public void QuoteChar ()
 		{
 			string xml = @"<a value='hello &amp; world' value2="""" />";
 			XmlReader xmlReader =
 				new XmlTextReader (new StringReader (xml));
 			xmlReader.Read ();
 			xmlReader.MoveToFirstAttribute ();
-			AssertEquals ("First", '\'', xmlReader.QuoteChar);
+			Assertion.AssertEquals ("First", '\'', xmlReader.QuoteChar);
 			xmlReader.MoveToNextAttribute ();
-			AssertEquals ("Next", '"', xmlReader.QuoteChar);
+			Assertion.AssertEquals ("Next", '"', xmlReader.QuoteChar);
 			xmlReader.MoveToFirstAttribute ();
-			AssertEquals ("First.Again", '\'', xmlReader.QuoteChar);
+			Assertion.AssertEquals ("First.Again", '\'', xmlReader.QuoteChar);
 		}
 	}
 }

+ 19 - 16
mcs/class/System.XML/Test/XmlTextTests.cs

@@ -1,10 +1,12 @@
 //
 // System.Xml.XmlTextWriterTests
 //
-// Author:
+// Authors:
 //   Kral Ferch <[email protected]>
+//   Martin Willemoes Hansen <[email protected]>
 //
 // (C) 2002 Kral Ferch
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -13,11 +15,9 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlTextTests : TestCase
+	[TestFixture]
+	public class XmlTextTests
 	{
-		public XmlTextTests () : base ("MonoTests.System.Xml.XmlTextTests testsuite") {}
-		public XmlTextTests (string name) : base (name) {}
-
 		XmlDocument document;
 		XmlText text;
 		bool inserted;
@@ -27,7 +27,8 @@ namespace MonoTests.System.Xml
 		bool removed;
 		bool removing;
 
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 		}
@@ -62,14 +63,16 @@ namespace MonoTests.System.Xml
 			removing = true;
 		}
 
-		public void TestInnerAndOuterXml ()
+		[Test]
+		public void InnerAndOuterXml ()
 		{
 			text = document.CreateTextNode ("&<>\"'");
-			AssertEquals (String.Empty, text.InnerXml);
-			AssertEquals ("&amp;&lt;&gt;\"'", text.OuterXml);
+			Assertion.AssertEquals (String.Empty, text.InnerXml);
+			Assertion.AssertEquals ("&amp;&lt;&gt;\"'", text.OuterXml);
 		}
 		
-		public void TestSplitText ()
+		[Test]
+		public void SplitText ()
 		{
 			document.LoadXml ("<root>test text.</root>");
 			document.NodeInserted += new XmlNodeChangedEventHandler(EventNodeInserted);
@@ -77,12 +80,12 @@ namespace MonoTests.System.Xml
 			document.NodeRemoved += new XmlNodeChangedEventHandler(EventNodeRemoved);
 			XmlText t = document.DocumentElement.FirstChild as XmlText;
 			t.SplitText (5);
-			AssertNotNull (t.NextSibling);
-			AssertEquals ("test ", t.Value);
-			AssertEquals ("text.", t.NextSibling.Value);
-			Assert (changed);
-			Assert (inserted);
-			Assert (!removed);
+			Assertion.AssertNotNull (t.NextSibling);
+			Assertion.AssertEquals ("test ", t.Value);
+			Assertion.AssertEquals ("text.", t.NextSibling.Value);
+			Assertion.Assert (changed);
+			Assertion.Assert (inserted);
+			Assertion.Assert (!removed);
 		}
 	}
 }

Fichier diff supprimé car celui-ci est trop grand
+ 257 - 207
mcs/class/System.XML/Test/XmlTextWriterTests.cs


+ 39 - 31
mcs/class/System.XML/Test/XmlWhiteSpaceTests.cs

@@ -1,10 +1,12 @@
 //
 // System.Xml.XmlWhitespaceTests.cs
 //
-// Author:
+// Authors:
 //	Duncan Mak  ([email protected])
+//      Martin Willemoes Hansen ([email protected])
 //
 // (C) Ximian, Inc.
+// (C) 2003 Martin Willemoes Hansen
 //
 
 using System;
@@ -14,7 +16,8 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlWhitespaceTests : TestCase
+	[TestFixture]
+	public class XmlWhiteSpaceTests
 	{
 		XmlDocument document;
 		XmlDocument doc2;
@@ -24,10 +27,8 @@ namespace MonoTests.System.Xml
 		XmlNode deep;
 		XmlNode shallow;
 		
-		public XmlWhitespaceTests () : base ("MonoTests.System.Xml.XmlWhitespaceTests testsuite") {}
-		public XmlWhitespaceTests (string name) : base (name) {}
-
-		protected override void SetUp ()
+		[SetUp]
+		public void GetReady ()
 		{
 			document = new XmlDocument ();
 			document.LoadXml ("<root><foo></foo></root>");
@@ -39,25 +40,27 @@ namespace MonoTests.System.Xml
 			doc2.PreserveWhitespace = true;
 		}
 
-		public void TestInnerAndOuterXml ()
+		[Test]
+		public void InnerAndOuterXml ()
 		{
 			whitespace = doc2.CreateWhitespace ("\r\n\t ");
-			AssertEquals (String.Empty, whitespace.InnerXml);
-			AssertEquals ("\r\n\t ", whitespace.OuterXml);
+			Assertion.AssertEquals (String.Empty, whitespace.InnerXml);
+			Assertion.AssertEquals ("\r\n\t ", whitespace.OuterXml);
 		}
 			
-		internal void TestXmlNodeBaseProperties (XmlNode original, XmlNode cloned)
+		internal void XmlNodeBaseProperties (XmlNode original, XmlNode cloned)
 		{
 //			assertequals (original.nodetype + " was incorrectly cloned.",
 //				      original.baseuri, cloned.baseuri);			
-			AssertNull (cloned.ParentNode);
-			AssertEquals ("Value incorrectly cloned",
+			Assertion.AssertNull (cloned.ParentNode);
+			Assertion.AssertEquals ("Value incorrectly cloned",
 				       cloned.Value, original.Value);
 			
-                        Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
+                        Assertion.Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
 		}
 
-		public void TestXmlWhitespaceBadConstructor ()
+		[Test]
+		public void XmlWhitespaceBadConstructor ()
 		{
 			try {
 				broken = document.CreateWhitespace ("black");				
@@ -66,52 +69,57 @@ namespace MonoTests.System.Xml
 				return;
 
 			} catch (Exception) {
-				Fail ("Incorrect Exception thrown.");
+				Assertion.Fail ("Incorrect Exception thrown.");
 			}
 		}
 
-		public void TestXmlWhitespaceConstructor ()
+		[Test]
+		public void XmlWhitespaceConstructor ()
 		{
-			AssertEquals ("whitespace char didn't get copied right",
+			Assertion.AssertEquals ("whitespace char didn't get copied right",
 				      "\r\n", whitespace.Data);
 		}
-		
-	       
-		public void TestXmlWhitespaceName ()
+			       
+		[Test]
+		public void XmlWhitespaceName ()
 		{
-			AssertEquals (whitespace.NodeType + " Name property broken",
+			Assertion.AssertEquals (whitespace.NodeType + " Name property broken",
 				      whitespace.Name, "#whitespace");
 		}
 
-		public void TestXmlWhitespaceLocalName ()
+		[Test]
+		public void XmlWhitespaceLocalName ()
 		{
-			AssertEquals (whitespace.NodeType + " LocalName property broken",
+			Assertion.AssertEquals (whitespace.NodeType + " LocalName property broken",
 				      whitespace.LocalName, "#whitespace");
 		}
 
-		public void TestXmlWhitespaceNodeType ()
+		[Test]
+		public void XmlWhitespaceNodeType ()
 		{
-			AssertEquals ("XmlWhitespace NodeType property broken",
+			Assertion.AssertEquals ("XmlWhitespace NodeType property broken",
 				      whitespace.NodeType.ToString (), "Whitespace");
 		}
 
-		public void TestXmlWhitespaceIsReadOnly ()
+		[Test]
+		public void XmlWhitespaceIsReadOnly ()
 		{
-			AssertEquals ("XmlWhitespace IsReadOnly property broken",
+			Assertion.AssertEquals ("XmlWhitespace IsReadOnly property broken",
 				      whitespace.IsReadOnly, false);
 		}
 
-		public void TestXmlWhitespaceCloneNode ()
+		[Test]
+		public void XmlWhitespaceCloneNode ()
 		{
 			original = whitespace;
 
 			shallow = whitespace.CloneNode (false); // shallow
-			TestXmlNodeBaseProperties (original, shallow);
+			XmlNodeBaseProperties (original, shallow);
 						
 			deep = whitespace.CloneNode (true); // deep
-			TestXmlNodeBaseProperties (original, deep);			
+			XmlNodeBaseProperties (original, deep);			
 
-                        AssertEquals ("deep cloning differs from shallow cloning",
+                        Assertion.AssertEquals ("deep cloning differs from shallow cloning",
 				      deep.OuterXml, shallow.OuterXml);
 		}
 	}

+ 11 - 16
mcs/class/System.XML/Test/XmlWriterTests.cs

@@ -1,17 +1,17 @@
 //
 // System.Xml.XmlTextWriterTests
 //
-// Author:
+// Authors:
 //   Atsushi Enomoto <[email protected]>
+//   Martin Willemoes Hansen <[email protected]>
 //
 // (C) 2003 Atsushi Enomoto
+// (C) 2003 Martin Willemoes Hansen
 //
 //
 //  This class mainly checks inheritance and behaviors of XmlWriter.
 //
 
-
-
 using System;
 using System.IO;
 using System.Text;
@@ -21,30 +21,25 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Xml
 {
-	public class XmlWriterTests : TestCase
+	[TestFixture]
+	public class XmlWriterTests
 	{
-		public XmlWriterTests () : base ("MonoTests.System.Xml.XmlWriterTests testsuite") {}
-		public XmlWriterTests (string name) : base (name) {}
-
-		protected override void SetUp ()
-		{
-		}
-
 		// MS.NET's not-overriden XmlWriter.WriteStartElement(name)
 		// invokes WriteStartElement(null, name, null). 
 		// WriteStartElement(name, ns) invokes (null, name, ns), too.
-		public void TestStartElement ()
+		[Test]
+		public void StartElement ()
 		{
 			StartElementTestWriter xw = new StartElementTestWriter ();
 			xw.WriteStartDocument ();
 			xw.WriteStartElement ("test");
-			AssertEquals ("StartElementOverride.NS", null, xw.NS);
-			AssertEquals ("StartElementOverride.Prefix", null, xw.Prefix);
+			Assertion.AssertEquals ("StartElementOverride.NS", null, xw.NS);
+			Assertion.AssertEquals ("StartElementOverride.Prefix", null, xw.Prefix);
 			xw.NS = String.Empty;
 			xw.Prefix = String.Empty;
 			xw.WriteStartElement ("test", "urn:hoge");
-			AssertEquals ("StartElementOverride.NS", "urn:hoge", xw.NS);
-			AssertEquals ("StartElementOverride.Prefix", null, xw.Prefix);
+			Assertion.AssertEquals ("StartElementOverride.NS", "urn:hoge", xw.NS);
+			Assertion.AssertEquals ("StartElementOverride.Prefix", null, xw.Prefix);
 		}
 		
 		class StartElementTestWriter : DefaultXmlWriter

+ 16 - 11
mcs/class/System.XML/Test/makefile.gnu

@@ -3,20 +3,25 @@ topdir = ../../..
 LIBRARY = System.XML_linux_test.dll
 
 LIB_LIST = System.XML_linux_test.args
-LIB_FLAGS = \
-	-r $(topdir)/class/lib/corlib.dll	\
-	-r $(topdir)/class/lib/System.Xml.dll	\
-	-r $(topdir)/class/lib/NUnitCore_mono.dll
+LIB_FLAGS = 	\
+		-r $(topdir)/class/lib/corlib.dll	\
+		-r $(topdir)/class/lib/System.Xml.dll	\
+		-r $(topdir)/nunit20/NUnit.Framework.dll
 
-SOURCES_INCLUDE = *.cs
-SOURCES_EXCLUDE = ./TheTests.cs
+ifdef SUBDIR
+USE_SOURCE_RULES=1
+SOURCES_INCLUDE=./$(SUBDIR)/*.cs
+SOURCES_EXCLUDE=./TheTests.cs
+endif
 
 include $(topdir)/class/library.make
 
-MCS_FLAGS = --target library --noconfig
+NUNITCONSOLE=$(topdir)/nunit20/nunit-console.exe
+MONO_PATH = $(topdir)/nunit20:.
 
-TEST_SUITE_PREFIX = MonoTests.System.Xml.
-TEST_SUITE = AllTests
+test: $(LIBRARY) run_test
 
-test: $(LIBRARY)
-	-MONO_PATH=$(MONO_PATH) mono $(topdir)/class/lib/NUnitConsole_mono.exe $(TEST_SUITE_PREFIX)$(TEST_SUITE),System.XML_linux_test.dll
+.PHONY: run_test
+
+run_test:
+	-MONO_PATH=$(MONO_PATH) mono --debug $(NUNITCONSOLE) $(LIBRARY)

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff