2 // System.Xml.NameTableTests.cs
4 // Author: Duncan Mak (duncan@ximian.com)
12 using NUnit.Framework;
14 namespace MonoTests.System.Xml
16 public class NameTableTests : TestCase
20 public NameTableTests (string name)
25 protected override void SetUp ()
27 table = new NameTable ();
31 // Tests System.Xml.NameTable.Add (string)
33 public void TestAdd1 ()
36 string testAdd = table.Add (add);
37 AssertEquals (add, testAdd);
38 AssertSame (add, testAdd);
42 // Tests System.Xml.NameTable.Add (char[], int, int)
44 public void TestAdd2 ()
46 char[] test = new char [4] { 'a', 'd', 'd', '2' };
48 int length = 3; // "add"
50 AssertEquals ("add", table.Add (test, index, length));
54 // Tests System.Xml.NameTable.Get (string)
56 public void TestGet1 ()
59 string testGet = table.Add (get1);
61 AssertEquals (table.Get (get1), testGet);
62 AssertSame (get1, testGet );
66 // Tests System.Xml.NameTable.Get (char[], int, int)
68 public void TestGet2 ()
70 char[] test = new char [4] { 'g', 'e', 't', '2' };
72 int length = 3; // "get"
74 string testGet = table.Add (test, index, length);
76 AssertEquals (table.Get (test, index, length), testGet);
80 // Tests System.Xml.NameTable.Get (char[], int, 0)
82 public void TestGet3 ()
84 char[] test = new char [4] { 't', 'e', 's', 't' };
88 AssertEquals (table.Get (test, index, length), String.Empty);