Remove fixed testcases from known failures list.
[mono.git] / mcs / class / System.XML / Test / System.Xml / NameTableTests.cs
1 //
2 // System.Xml.NameTableTests.cs
3 //
4 // Author: Duncan Mak (duncan@ximian.com)
5 // Author: Martin Willemoes Hansen (mwh@sysrq.dk)
6 //
7 // (C) Ximian, Inc.
8 // (C) 2003 Martin Willemoes Hansen
9 //
10
11 using System;
12 using System.Xml;
13
14 using NUnit.Framework;
15
16 namespace MonoTests.System.Xml
17 {
18         [TestFixture]
19         public class NameTableTests : Assertion
20         {
21                 NameTable table;
22                 
23                 [SetUp]
24                 public void GetReady ()
25                 {
26                         table = new NameTable ();
27                 }
28
29                 //
30                 // Tests System.Xml.NameTable.Add (string)
31                 //              
32                 [Test]
33                 public void Add1 ()
34                 {
35                         string add = "add1";
36                         string testAdd = table.Add (add);
37                         AssertEquals (add, testAdd);
38                         AssertSame (add, testAdd);
39                 }
40
41                 //
42                 // Tests System.Xml.NameTable.Add (char[], int, int)
43                 //              
44                 [Test]
45                 public void Add2 ()
46                 {
47                         char[] test = new char [4] { 'a', 'd', 'd', '2' };
48                         int index = 0;
49                         int length = 3; // "add"                        
50
51                         AssertEquals ("add", table.Add (test, index, length));
52                 }
53
54                 //
55                 // Tests System.Xml.NameTable.Get (string)
56                 //
57                 [Test]
58                 public void Get1 ()
59                 {
60                         string get1 = "get1";
61                         string testGet = table.Add (get1);
62                         AssertEquals ("#1", "get1", testGet);
63
64                         AssertEquals ("#2", testGet, table.Get (get1));
65                         AssertSame ("#3", get1, testGet );
66                 }
67
68                 //
69                 // Tests System.Xml.NameTable.Get (char[], int, int)
70                 //
71                 [Test]
72                 public void Get2 ()
73                 {                                               
74                         char[] test = new char [4] { 'g', 'e', 't', '2' };
75                         int index = 0; 
76                         int length = 3; // "get"
77                         
78                         string testGet = table.Add (test, index, length);
79                         AssertEquals ("#1", "get", testGet);
80
81                         AssertEquals ("#2", testGet, table.Get ("get"));
82                         AssertEquals ("#3", testGet, table.Get (test, index, length));
83                 }
84
85                 //
86                 // Tests System.Xml.NameTable.Get (char[], int, 0)
87                 //
88                 [Test]
89                 public void Get3 ()
90                 {
91                         char[] test = new char [4] { 't', 'e', 's', 't' };
92                         int index = 0;
93                         int length = 0;
94
95                         AssertEquals (String.Empty, table.Get (test, index, length));
96                 }
97         }
98 }