2009-07-11 Michael Barker <mike@middlesoft.co.uk>
[mono.git] / mcs / class / System.XML / Test / System.Xml / nist_dom / fundamental / Comment / Comment.cs
1 //**************************************************************************\r
2 //\r
3 //\r
4 //                       National Institute Of Standards and Technology\r
5 //                                     DTS Version 1.0\r
6 //         \r
7 //                                      Comment Interface\r
8 //\r
9 // Written by: Carmelo Montanez\r
10 //\r
11 // Ported to System.Xml by: Mizrahi Rafael rafim@mainsoft.com\r
12 // Mainsoft Corporation (c) 2003-2004\r
13 //\r
14 //**************************************************************************\r
15 using System;\r
16 using System.Xml;\r
17 using nist_dom;\r
18 using NUnit.Framework;\r
19 \r
20 namespace nist_dom.fundamental\r
21 {\r
22     /// <summary>\r
23     /// Summary description for Comment.\r
24     /// </summary>\r
25     [TestFixture]\r
26     public class CommentTest//,ITest\r
27     {\r
28         public static int i = 1;\r
29 /*\r
30         public testResults[] RunTests()\r
31         {\r
32             testResults[] tests = new testResults[] {core0001CO()};\r
33   \r
34             return tests;\r
35         }\r
36 */\r
37         //------------------------ test case core-0001CO ------------------------\r
38         //\r
39         // Testing feature - A comment is all the characters between the starting \r
40         //                   "<!--" and ending "-->" strings. \r
41         //\r
42         // Testing approach - Retrieve the third child in the DOM document.  \r
43         //                    This node is a comment node and its value is the \r
44         //                    content of the node.\r
45         //\r
46         // Semantic Requirements: 1\r
47         //\r
48         //----------------------------------------------------------------------------\r
49 \r
50         [Test]\r
51         public void core0001CO()\r
52         {\r
53             string computedValue = "";\r
54             string expectedValue = " This is comment number 1.";\r
55             System.Xml.XmlNode testNode = null;\r
56 \r
57             testResults results = new testResults("Core0001CO");\r
58 \r
59             results.description = "A comment is all the characters between the " + "start comment and end comment strings.";\r
60             //\r
61             // Retrieve the targeted data and access its nodeValue.\r
62             //\r
63             testNode = util.getDOMDocument().ChildNodes.Item(2); \r
64             computedValue = testNode.Value;//nodeValue;\r
65             //\r
66             // Write out results \r
67             //\r
68 \r
69             results.expected = expectedValue;\r
70             results.actual = computedValue;\r
71 \r
72             Assert.AreEqual (results.expected, results.actual);\r
73         }\r
74 \r
75         //------------------------ End test case core-0001CO --------------------------\r
76     }\r
77 \r
78 }\r