2009-06-26 Robert Jordan <robertj@gmx.net>
[mono.git] / mcs / class / System.XML / Test / System.Xml / nist_dom / fundamental / CharacterData / CharacterData.cs
1 //**************************************************************************
2 //
3 //
4 //                       National Institute Of Standards and Technology
5 //                                     DTS Version 1.0
6 //         
7 //                                 CharacterData Interface
8 //
9 // Written by: Carmelo Montanez
10 // Modified by:  Mary Brady
11 //
12 // Ported to System.Xml by: Mizrahi Rafael rafim@mainsoft.com
13 // Mainsoft Corporation (c) 2003-2004
14 //**************************************************************************
15 using System;
16 using System.Xml;
17
18 using nist_dom;
19 using NUnit.Framework;
20
21 namespace nist_dom.fundamental
22 {
23         [TestFixture]
24         public class CharacterDataTest//,ITest
25         {
26                 public static int i = 2;
27 /*
28                 public testResults[] RunTests()
29                 {
30                         testResults[] tests = new testResults[] {core0001C(), core0002C(), core0003C(),core0004C(),
31                                                                                                                 core0005C(), core0006C(), core0007C(), core0008C(),
32                                                                                                                 core0009C(), core0010C(), core0011C(), core0012C(),
33                                                                                                                 core0013C(), core0014C(), core0015C(),
34                                                                                                                 core0016C(), core0017C(), core0018C(), core0019C(),
35                                                                                                                 core0020C(), core0021C(), core0022C(), core0023C(),
36                                                                                                                 core0024C(), core0025C(), core0026C(), core0027C(),
37                                                                                                                 core0028C(), core0029C(), core0030C(), core0031C(),
38                                                                                                                 core0032C(), core0033C(), core0034C(), core0035C(),
39                                                                                                                 core0036C()};
40   
41                         return tests;
42                 }
43 */
44                 //------------------------ test case core-0001C ------------------------
45                 //
46                 // Testing feature -  The "data" attribute is the character data that
47                 //                    implements this interface.
48                 //
49                 // Testing approach - Retrieve the character data from the second child of
50                 //                    the first employee and invoke its "data" attribute.  The 
51                 //                    attribute should return the actual data.
52                 //                    
53                 // Semantic Requirements: 1
54                 //
55                 //----------------------------------------------------------------------------
56
57                 [Test]
58                 public void core0001C()
59                 {
60                         string computedValue = "";
61                         string expectedValue = "Margaret Martin";
62                         System.Xml.XmlNode testNode = null;
63                         System.Xml.XmlCharacterData testNodeData = null;
64
65                         testResults results = new testResults("Core0001C");
66                         try
67                         {
68                                 results.description = "The \"data\" attribute is the character data that " +
69                                         "implements this interface.";
70                                 //
71                                 // Access the targeted data.
72                                 //
73                                 testNode = util.nodeObject(util.FIRST,util.SECOND);
74                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild; 
75                                 computedValue = testNodeData.Data;
76                         }
77                         catch(System.Exception ex)
78                         {
79                                 computedValue = "Exception " + ex.Message;
80                         }
81                         //
82                         // Write out results 
83                         //
84                         results.expected = expectedValue;
85                         results.actual = computedValue;
86
87                         Assert.AreEqual (results.expected, results.actual);
88                 }
89
90                 //------------------------ End test case core-0001C --------------------------
91                 //
92                 //--------------------------- test case core-0002C ---------------------------
93                 //
94                 // Testing feature -  The "length" attribute contains the number of 16-bit 
95                 //                    units that are available through the data attribute and
96                 //                    the substringData method.  Test for the "data" attribute.
97                 //
98                 // Testing approach - Retrieve the character data from the second child of
99                 //                    the first employee and access its data by using the
100                 //                    "data" attribute.  Finally the "length" attribute
101                 //                    is used on the character data returned by the "data"
102                 //                    attribute to determine the number of 16 bit units in
103                 //                    the data.
104                 //
105                 // Semantic Requirements: 2 
106                 //
107                 //----------------------------------------------------------------------------
108
109                 [Test]
110                 public void core0002C()
111                 {
112                         string computedValue = "";
113                         string expectedValue = "15";
114                         System.Xml.XmlNode testNode = null;
115                         System.Xml.XmlCharacterData testNodeData = null;
116
117                         testResults results = new testResults("Core0002C");
118                         try
119                         {
120                                 results.description = "The \"length\" attribute is the number of 16-bit units " +
121                                         "that are available through the \"data\" attribute " +
122                                         "and the \"substringData\" method (test for \"data\").";
123                                 //
124                                 // Retrieve the targeted data and invoke its "data" attribute.
125                                 //
126                                 testNode = util.nodeObject(util.FIRST,util.SECOND);
127                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
128                                 computedValue = testNodeData.Length.ToString();
129                         }
130                         catch(System.Exception ex)
131                         {
132                                 computedValue = "Exception " + ex.Message;
133                         }
134                         //
135                         // Write out results
136                         //
137                         results.expected = expectedValue;
138                         results.actual = computedValue;
139
140                         Assert.AreEqual (results.expected, results.actual);
141                 }
142
143                 //------------------------ End test case core-0002C --------------------------
144                 //
145                 //--------------------------- test case core-0003C ---------------------------
146                 //
147                 // Testing feature -  The "length" attribute contains the number of 16-bit units 
148                 //                    that are available through the data attribute and the
149                 //                    substringData method.  Test for the "substringData"
150                 //                    method.
151                 //
152                 // Testing approach - Retrieve the character data of the second child of the
153                 //                    first employee and access part of the data by using the 
154                 //                    "substringData(offset,count)" method.  Finally the 
155                 //                    "length" attribute is used on the character data 
156                 //                    returned by the "substringData(offset,count)" method 
157                 //                    to determine the number of 16-bit units in the data.
158                 //
159                 // Semantic Requirements: 2
160                 //
161                 //----------------------------------------------------------------------------
162
163                 [Test]
164                 public void core0003C()
165                 {
166                         string computedValue = "";
167                         string expectedValue = "8";
168                         System.Xml.XmlNode testNode = null;
169                         System.Xml.XmlCharacterData testNodeData = null;
170                         string subString = "";
171
172                         testResults results = new testResults("Core0003C");
173                         try
174                         {
175                                 results.description = "The \"length\" attribute is the number of 16-bit units " +
176                                         "that are available through the \"data\" attribute " +
177                                         "and the \"substringData\" method (test for \"substringData\").";
178                                 //
179                                 // Retrieve the targeted data and invoke its "substringData" method.
180                                 //
181                                 testNode = util.nodeObject(util.FIRST,util.SECOND);
182                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
183                                 subString = testNodeData.Substring(0,8);
184                                 computedValue = subString.Length.ToString();
185                         }
186                         catch(System.Exception ex)
187                         {
188                                 computedValue = "Exception " + ex.Message;
189                         }
190                         //
191                         // write out results
192                         //
193                         results.expected = expectedValue;
194                         results.actual = computedValue;
195
196                         Assert.AreEqual (results.expected, results.actual);
197                 }
198
199                 //------------------------ End test case core-0003C --------------------------
200                 //
201                 //--------------------------- test case core-0004C ---------------------------
202                 //
203                 // Testing feature -  The "substringData(offset,count)" method returns the
204                 //                    specified substring.
205                 //
206                 // Testing approach - Retrieve the character data from the second child of the
207                 //                    first employee and access part of the data by using the
208                 //                    "substringData(offset,count)" method.  The method should
209                 //                    return the specified substring starting at position
210                 //                    "offset" and extract "count" characters.  The method
211                 //                    method should return the string "Margaret".
212                 //
213                 // Semantic Requirements: 3 
214                 //
215                 //----------------------------------------------------------------------------
216
217                 [Test]
218                 public void core0004C()
219                 {
220                         //string testName = "core-0004C";
221                         string computedValue = "";
222                         string expectedValue = "Margaret";
223                         System.Xml.XmlNode testNode = null;
224                         System.Xml.XmlCharacterData testNodeData = null;
225
226                         testResults results = new testResults("Core0004C");
227                         try
228                         {
229                                 results.description = "The \"substringData(offset,count)\" method returns the " +
230                                         "specified substring.";
231                                 //
232                                 // Retrieve the targeted data and invoke its "substringData" method.
233                                 //
234                                 testNode = util.nodeObject(util.FIRST,util.SECOND);
235                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
236                                 computedValue = testNodeData.Substring(0,8);
237                         }
238                         catch(System.Exception ex)
239                         {
240                                 computedValue = "Exception " + ex.Message;
241                         }
242                         //
243                         // Write out results
244                         //
245                         results.expected = expectedValue;
246                         results.actual = computedValue;
247
248                         Assert.AreEqual (results.expected, results.actual);
249                 }
250
251                 //------------------------ End test case core-0004C --------------------------
252                 //
253                 //--------------------------- test case core-0005C ---------------------------
254                 //
255                 // Testing feature -  If the sum of "offset" and "count" exceeds "length" then 
256                 //                    the substringData(offset,count) method returns all 
257                 //                    the 16-bit units to the end of the data. 
258                 //
259                 // Testing approach - Retrieve the character data from the second child of the
260                 //                    first employee and access part of the data by using the
261                 //                    "substringData(offset,count)" method with offset = 9 and
262                 //                    count = 10.  The method should return the substring
263                 //                    "Martin" since offset + count > length (19 > 15).
264                 //
265                 // Semantic Requirements: 4 
266                 //
267                 //----------------------------------------------------------------------------
268
269                 [Test]
270                 public void core0005C()
271                 {
272                         string computedValue = "";
273                         string expectedValue = "Martin";
274                         System.Xml.XmlNode testNode = null;
275                         System.Xml.XmlCharacterData testNodeData = null;
276
277                         testResults results = new testResults("Core0005C");
278                         try
279                         {
280                                 results.description = "If the sum of \"offset\" and \"count\" exceeds " +
281                                         "the value of the \"length\" attribute then the " +
282                                         "\"substringData(offset,count)\" method returns all " +
283                                         "the 16-bit units to the end of the data.";
284                                 //
285                                 // Retrieve the targeted data and invoke its "substringData" method.
286                                 //
287                                 testNode = util.nodeObject(util.FIRST,util.SECOND);
288                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
289                                 computedValue = testNodeData.Substring(9,10);
290                         }
291                         catch(System.Exception ex)
292                         {
293                                 computedValue = "Exception " + ex.Message;
294                         }
295
296                         //
297                         // Write out results
298                         //
299                         results.expected = expectedValue;
300                         results.actual = computedValue;
301
302                         Assert.AreEqual (results.expected, results.actual);
303                 }
304
305                 //------------------------ End test case core-0005C --------------------------
306                 //
307                 //--------------------------- test case core-0006C ---------------------------
308                 //
309                 // Testing feature - The "appendData(arg)" method appends a string to the end
310                 //                   of the character data of the node.
311                 //
312                 // Testing approach - Retrieve the character data from the second child of the
313                 //                    first employee.  The "appendData(arg)" method is then 
314                 //                    called with arg = ", Esquire".  The method should append 
315                 //                    the specified data to the already existing character 
316                 //                    data.  The new value of the "length" attribute should 
317                 //                    be 24.
318                 //
319                 // Semantic Requirements: 5 
320                 //
321                 //----------------------------------------------------------------------------
322
323                 [Test]
324                 public void core0006C()
325                 {
326                         string computedValue = "";
327                         string expectedValue = "24";
328                         System.Xml.XmlNode testNode = null;
329                         System.Xml.XmlCharacterData testNodeData = null;
330
331                         testResults results = new testResults("Core0006C");
332                         try
333                         {
334                                 results.description = "The \"appendData(arg)\" method appends the specified " +
335                                         "string to the end of the character data of the node.";
336                                 //
337                                 // Retrieve targeted data and invoke the "appendData" method.
338                                 //
339                                 testNode = util.nodeObject(util.FIRST,util.SECOND); 
340                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
341                                 testNodeData.AppendData(", Esquire");;
342                                 computedValue = testNodeData.Length.ToString();
343                         }
344                         catch(System.Exception ex)
345                         {
346                                 computedValue = "Exception " + ex.Message;
347                         }
348                         //
349                         // Write out results
350                         //
351                         results.expected = expectedValue;
352                         results.actual = computedValue;
353
354                         util.resetData();
355
356                         Assert.AreEqual (results.expected, results.actual);
357                 }
358
359                 //------------------------ End test case core-0006C --------------------------
360                 //
361                 //--------------------------- test case core-0007C ---------------------------
362                 //
363                 // Testing feature - Upon successful invocation of the "appendData(arg)" 
364                 //                   method, the "data" attribute provides access to the
365                 //                   concatenation of data and the specified DOMString.
366                 //
367                 // Testing approach - Retrieve the character data from the second child of 
368                 //                    the first employee.  The "appendData(arg)" method is 
369                 //                    then called with arg = ", Esquire".  The method should 
370                 //                    append the specified data to the already existing 
371                 //                    character data.  The new value of the "data" attribute 
372                 //                    should be "Margaret Martin, Esquire".
373                 //
374                 // Semantic Requirements: 6 
375                 //
376                 //----------------------------------------------------------------------------
377
378                 [Test]
379                 public void core0007C()
380                 {
381                         string computedValue = "";
382                         string expectedValue = "Margaret Martin, Esquire";
383                         System.Xml.XmlNode testNode = null;
384                         System.Xml.XmlCharacterData testNodeData = null;
385
386                         testResults results = new testResults("Core0007C");
387                         try
388                         {
389                                 results.description = "Upon successful invocation of the \"appendData(arg)\" " +
390                                         "method ,the \"data\" attribute provides access " +
391                                         "to the concatenation of \"data\" and the specified DOMString.";
392                                 //
393                                 // Retrieve targeted data and invoke its "appendData" method.
394                                 //
395                                 testNode = util.nodeObject(util.FIRST,util.SECOND);
396                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
397                                 testNodeData.AppendData(", Esquire");
398                                 computedValue = testNodeData.Data;
399                         }
400                         catch(System.Exception ex)
401                         {
402                                 computedValue = "Exception " + ex.Message;
403                         }
404                         //
405                         // Write out results
406                         //
407                         results.expected = expectedValue;
408                         results.actual = computedValue;
409
410                         util.resetData();
411
412                         Assert.AreEqual (results.expected, results.actual);
413                 }
414
415                 //------------------------ End test case core-0007C --------------------------
416                 //
417                 //--------------------------- test case core-0008C ---------------------------
418                 //
419                 // Testing feature - The "insertData(offset,arg)" method insert a string at the
420                 //                   specified 16-bit unit offset.  Insert at the beginning of
421                 //                   the character data.
422                 //
423                 // Testing approach - Retrieve the character data from the second child of 
424                 //                    the first employee.  The "insertData(offset,arg)" 
425                 //                    method is then called with offset = 0 and arg = "Mss.".
426                 //                    The method should insert the string "Mss." at position 
427                 //                    0.  The new value of the character data should be "Mss.
428                 //                    Margaret Martin".
429                 //
430                 // Semantic Requirements: 7 
431                 //
432                 //----------------------------------------------------------------------------
433
434                 [Test]
435                 public void core0008C()
436                 {
437                         string computedValue = "";
438                         string expectedValue = "Mss. Margaret Martin";
439                         System.Xml.XmlNode testNode = null;
440                         System.Xml.XmlCharacterData testNodeData = null;
441
442                         testResults results = new testResults("Core0008C");
443                         try
444                         {
445                                 results.description = "Insert a string at the beginning of character data.";
446                                 //
447                                 // Retrieve the targeted data and invoke its "insertData" method.
448                                 //
449                                 testNode = util.nodeObject(util.FIRST,util.SECOND);
450                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
451                                 testNodeData.InsertData(0,"Mss. ");
452                                 computedValue = testNodeData.Data;
453                         }
454                         catch(System.Exception ex)
455                         {
456                                 computedValue = "Exception " + ex.Message;
457                         }
458                         //
459                         //    Write out results
460                         //
461                         results.expected = expectedValue;
462                         results.actual = computedValue;
463
464                         util.resetData();
465
466                         Assert.AreEqual (results.expected, results.actual);
467                 }
468
469                 //------------------------ End test case core-0008C --------------------------
470                 //
471                 //--------------------------- test case core-0009C ---------------------------
472                 //
473                 // Testing feature - The "insertData(offset,arg)" method insert a string at the
474                 //                   specified 16-bit units offset.  Insert in the middle of
475                 //                   the character data.
476                 //
477                 // Testing approach - Retrieve the character data from the second child of the
478                 //                    first employee.  The "insertData(offset,arg)" method is 
479                 //                    then called with offset = 9 and arg = "Ann".  The 
480                 //                    method should insert the string "Ann" at position 9.  
481                 //                    The new value of the character data should be 
482                 //                    "Margaret Ann Martin".
483                 //
484                 // Semantic Requirements: 7
485                 //
486                 //----------------------------------------------------------------------------
487
488                 [Test]
489                 public void core0009C()
490                 {
491                         string computedValue = "";//0;
492                         string expectedValue = "Margaret Ann Martin";
493                         System.Xml.XmlNode testNode = null;
494                         System.Xml.XmlCharacterData testNodeData = null;
495
496                         testResults results = new testResults("Core0009C");
497                         try
498                         {
499                                 results.description = "Insert a character string in the middle of character data."; 
500                                 //
501                                 // Retrieve targeted data and invoke its "insertData" method.
502                                 //
503                                 testNode = util.nodeObject(util.FIRST,util.SECOND);
504                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild; 
505                                 testNodeData.InsertData(9,"Ann ");
506                                 computedValue = testNodeData.Data;
507                         }
508                         catch(System.Exception ex)
509                         {
510                                 computedValue = "Exception " + ex.Message;
511                         }
512                         //
513                         //    Write out results
514                         //
515                         results.expected = expectedValue;
516                         results.actual = computedValue;
517
518                         util.resetData();
519
520                         Assert.AreEqual (results.expected, results.actual);
521                 }
522
523                 //------------------------ End test case core-0009C --------------------------
524                 //
525                 //--------------------------- test case core-0010C ---------------------------
526                 //
527                 // Testing feature - The "insertData(offset,arg)" method insert a string at the
528                 //                   specified 16-bit units offset.  Insert at the end of the
529                 //                   character data.
530                 //
531                 // Testing approach - Retrieve the character data from the second child of the
532                 //                    first employee.  The "insertData(offset,arg)" method 
533                 //                    is then called with offset = 14 and arg = ", Esquire".  
534                 //                    The method should insert the string ", Esquire" at 
535                 //                    position 14.  The new value of the character data 
536                 //                    should be "Margaret Martin, Esquire"
537                 //
538                 // Semantic Requirements: 7
539                 //
540                 //----------------------------------------------------------------------------
541
542                 [Test]
543                 public void core0010C()
544                 {
545                         string computedValue = "";
546                         string expectedValue = "Margaret Martin, Esquire";
547                         System.Xml.XmlNode testNode = null;
548                         System.Xml.XmlCharacterData testNodeData = null;
549
550                         testResults results = new testResults("Core0010C");
551                         try
552                         {
553                                 results.description = "Insert a string at the end of character data.";
554                                 //
555                                 // Retrieve the targeted data and invoke its "insertData" method.
556                                 //
557                                 testNode = util.nodeObject(util.FIRST,util.SECOND);
558                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild; 
559                                 testNodeData.InsertData(15,", Esquire");
560                                 computedValue = testNodeData.Data;
561                         }
562                         catch(System.Exception ex)
563                         {
564                                 computedValue = "Exception " + ex.Message;
565                         }
566                         //
567                         // Write out results
568                         //
569                         results.expected = expectedValue;
570                         results.actual = computedValue;
571
572                         util.resetData();
573
574                         Assert.AreEqual (results.expected, results.actual);
575                 }
576
577                 //------------------------ End test case core-0010C --------------------------
578                 //
579                 //--------------------------- test case core-0011C ---------------------------
580                 //
581                 // Testing feature - The "deleteData(offset,count)" method removes a range of
582                 //                   16-bit units from the node.  Delete at the beginning of the
583                 //                   character data.
584                 //
585                 // Testing approach - Retrieve the character data from the last child of the
586                 //                    first employee.  The "deleteData(offset,count)" 
587                 //                    method is then called with offset = 0 and count = 16.  
588                 //                    The method should delete the characters from position 0 
589                 //                    thru position 16.  The new value of the character data 
590                 //                    should be "Dallas, Texas 98551".
591                 //
592                 // Semantic Requirements: 8, 9 
593                 //
594                 //----------------------------------------------------------------------------
595
596                 [Test]
597                 public void core0011C()
598                 {
599                         string computedValue = "";
600                         string expectedValue = "Dallas, Texas 98551";
601                         System.Xml.XmlNode testNode = null;
602                         System.Xml.XmlCharacterData testNodeData = null;
603
604                         testResults results = new testResults("Core0011C");
605                         try
606                         {
607                                 results.description = "Delete character string from beginning of character data.";
608                                 //
609                                 // Retrieve the targeted data and invoke its "deleteData" method..
610                                 //
611                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
612                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
613                                 testNodeData.DeleteData(0,16);
614                                 computedValue = testNodeData.Data;
615                         }
616                         catch(System.Exception ex)
617                         {
618                                 computedValue = "Exception " + ex.Message;
619                         }
620                         //
621                         // Write out results
622                         //
623                         results.expected = expectedValue;
624                         results.actual = computedValue;
625
626                         util.resetData();
627
628                         Assert.AreEqual (results.expected, results.actual);
629                 }
630
631                 //------------------------ End test case core-0011C --------------------------
632                 //
633                 //--------------------------- test case core-0012C ---------------------------
634                 //
635                 // Testing feature - The "deleteData(offset,count)" method removes a range of
636                 //                   16-bit units from the node.  Delete in the middle of
637                 //                   the character data.
638                 //
639                 // Testing approach - Retrieve the character data from the last child of 
640                 //                    the first employee.  The "deleteData(offset,count)"
641                 //                    method is then called with offset = 16 and count = 8.
642                 //                    The method should delete the characters from position 16
643                 //                    thru position 24.  The new value of the character data
644                 //                    should be "1230 North Ave. Texas 98551".
645                 //
646                 // Semantic Requirements: 8, 9
647                 //
648                 //----------------------------------------------------------------------------
649
650                 [Test]
651                 public void core0012C()
652                 {
653                         string computedValue = "";
654                         string expectedValue = "1230 North Ave. Texas 98551";
655                         System.Xml.XmlNode testNode = null;
656                         System.Xml.XmlCharacterData testNodeData = null;
657
658                         testResults results = new testResults("Core0012C");
659                         try
660                         {
661                                 results.description = "Delete character string from the middle of character data.";
662                                 //
663                                 // Retrieve the targeted data and invoke its "deleteData" method.
664                                 //
665                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
666                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
667                                 testNodeData.DeleteData(16,8);
668                                 computedValue = testNodeData.Data;
669                         }
670                         catch(System.Exception ex)
671                         {
672                                 computedValue = "Exception " + ex.Message;
673                         }
674                         //
675                         // Write out results
676                         //
677                         results.expected = expectedValue;
678                         results.actual = computedValue;
679
680                         util.resetData();
681
682                         Assert.AreEqual (results.expected, results.actual);
683                 }
684
685                 //------------------------ End test case core-0012C --------------------------
686                 //
687                 //--------------------------- test case core-0013C ---------------------------
688                 //
689                 // Testing feature - The "deleteData(offset,count)" method removes a range of
690                 //                   16-bit units from the node.  Delete at the end of the
691                 //                   character data.
692                 //
693                 // Testing approach - Retrieve the character data from the last child of 
694                 //                    the first employee.  The "deleteData(offset,count)"
695                 //                    method is then called with offset = 30 and count = 5.
696                 //                    The method should delete the characters from position 30 
697                 //                    thru position 35.  The new value of the character data
698                 //                    should be "1230 North Ave. Dallas, Texas".
699                 //
700                 // Semantic Requirements: 8, 9
701                 //
702                 //----------------------------------------------------------------------------
703
704                 [Test]
705                 public void core0013C()
706                 {
707                         string computedValue = "";
708                         string expectedValue = "1230 North Ave. Dallas, Texas ";
709                         System.Xml.XmlNode testNode = null;
710                         System.Xml.XmlCharacterData testNodeData = null;
711
712                         testResults results = new testResults("Core0013C");
713                         try
714                         {
715                                 results.description = "Delete character string from the end of character data.";
716                                 //
717                                 // Retrieve the targeted data and invoke its "deleteData" method.
718                                 //
719                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
720                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
721                                 testNodeData.DeleteData(30,5);
722                                 computedValue = testNodeData.Data;
723                         }
724                         catch(System.Exception ex)
725                         {
726                                 computedValue = "Exception " + ex.Message;
727                         }
728                         //
729                         // Write out results
730                         //
731                         results.expected = expectedValue;
732                         results.actual = computedValue;
733
734                         util.resetData();
735
736                         Assert.AreEqual (results.expected, results.actual);
737                 }
738
739                 //------------------------ End test case core-0013C --------------------------
740                 //
741                 //--------------------------- test case core-0014C ---------------------------
742                 //
743                 // Testing feature - Upon successful invocation of the 
744                 //                   "deleteData(offset,count)" method, the data and length 
745                 //                   attributes reflect that change.
746                 //
747                 // Testing approach - Retrieve the character data of the last child of the
748                 //                    first employee.  The "deleteData(offset,count)"
749                 //                    method is then called with offset = 30 and count = 5.
750                 //                    The method should delete the characters from position 30 
751                 //                    thru position 35.  The new value of the character data
752                 //                    should be "1230 North Ave. Dallas, Texas" (the data
753                 //                    attribute) and its length attribute should be 30.  This
754                 //                    new values should be reflected immediately upon
755                 //                    its invocation. 
756                 //
757                 // Semantic Requirements: 9
758                 //
759                 //----------------------------------------------------------------------------
760
761                 [Test]
762                 public void core0014C()
763                 {
764                         string computedValue = "";
765                         string expectedValue = "1230 North Ave. Dallas, Texas 30";
766                         System.Xml.XmlNode testNode = null;
767                         System.Xml.XmlCharacterData testNodeData = null;
768
769                         testResults results = new testResults("Core0014C");
770                         try
771                         {
772                                 results.description = "Data and length attributes are updated as a result " +
773                                         "of the \"deleteData(offset, count)\" method.";
774                                 //
775                                 // Retrieve the targeted data and invoke its "deleteData" attribute.
776                                 //
777                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
778                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
779                                 testNodeData.DeleteData(30,5);
780                                 computedValue += testNodeData.Data;
781                                 computedValue += testNodeData.Length;
782                         }
783                         catch(System.Exception ex)
784                         {
785                                 computedValue = "Exception " + ex.Message;
786                         }
787  
788                         //
789                         // Write out results
790                         //
791                         results.expected = expectedValue;
792                         results.actual = computedValue;
793
794                         util.resetData();
795
796                         Assert.AreEqual (results.expected, results.actual);
797                 }
798
799                 //------------------------ End test case core-0014C --------------------------
800                 //
801                 //--------------------------- test case core-0015C ---------------------------
802                 //
803                 // Testing feature - If the sum of the offset and count attributes (from the
804                 //                   deleteData method) is greater than the length of the 
805                 //                   character data then all the 16-bit units from the offset 
806                 //                   to the end of the data are deleted.
807                 //
808                 // Testing approach - Retrieve the character data from the last child of the
809                 //                    first employee.  The "deleteData(offset,count)"
810                 //                    method is then called with offset = 4 and count = 50.
811                 //                    The method should delete the characters from position 4
812                 //                    to the end of the data since offset + count (50+4) is
813                 //                    greater than the length of the character data (35).  
814                 //                    The new value for the character data should be "1230".
815                 //
816                 // Semantic Requirements: 10 
817                 //
818                 //----------------------------------------------------------------------------
819
820                 [Test]
821                 public void core0015C()
822                 {
823                         string computedValue = "";
824                         string expectedValue = "1230";
825                         System.Xml.XmlNode testNode = null;
826                         System.Xml.XmlCharacterData testNodeData = null;
827
828                         testResults results = new testResults("Core0015C");
829                         try
830                         {
831                                 results.description = "If the sum of \"offset\" and \"count\" exceeds the " +
832                                         "length of the character data then all the " +
833                                         "16-bit units from the offset thru the end of the " +
834                                         "data are removed.<br>";
835                                 //
836                                 // Retrieve the targeted data and invoke its "deleteData" method.
837                                 //
838                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
839                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
840                                 testNodeData.DeleteData(4,50);
841                                 computedValue = testNodeData.Data;
842                         }
843                         catch(System.Exception ex)
844                         {
845                                 computedValue = "Exception " + ex.Message;
846                         }
847
848                         //
849                         // Write out results
850                         //
851                         results.expected = expectedValue;
852                         results.actual = computedValue;
853
854                         util.resetData();
855
856                         Assert.AreEqual (results.expected, results.actual);
857                 }
858
859                 //------------------------ End test case core-0015C --------------------------
860                 //
861                 //--------------------------- test case core-0016C ---------------------------
862                 //
863                 // Testing feature - The "replaceData(offset,count,arg)" method replace the 
864                 //                   characters starting at the specified 16-bit units with the
865                 //                   specified string.  Test for replacement at the 
866                 //                   beginning of the data.
867                 //
868                 // Testing approach - Retrieve the character data from the last child of the
869                 //                    first employee.  The "replaceData(offset,count,arg)"
870                 //                    method is then called with offset = 0 and count = 4 and
871                 //                    arg = "2500".  The method should replace the first four
872                 //                    characters of the character data with "2500".
873                 //
874                 // Semantic Requirements: 11 
875                 //
876                 //----------------------------------------------------------------------------
877
878                 [Test]
879                 public void core0016C()
880                 {
881                         string computedValue = "";//0;
882                         string expectedValue = "2500 North Ave. Dallas, Texas 98551";
883                         System.Xml.XmlNode testNode = null;
884                         System.Xml.XmlCharacterData testNodeData = null;
885
886                         testResults results = new testResults("Core0016C");
887                         try
888                         {
889                                 results.description = "Replace a character string at the beginning of character data.";
890                                 //
891                                 // Retrieve the targeted data and invoke its "replaceData" method .
892                                 //
893                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
894                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
895                                 testNodeData.ReplaceData(0,4,"2500");
896                                 computedValue = testNodeData.Data;
897                         }
898                         catch(System.Exception ex)
899                         {
900                                 computedValue = "Exception " + ex.Message;
901                         }
902
903                         //
904                         // Write out results
905                         //
906                         results.expected = expectedValue;
907                         results.actual = computedValue;
908
909                         util.resetData();
910
911                         Assert.AreEqual (results.expected, results.actual);
912                 }
913
914                 //------------------------ End test case core-0016C --------------------------
915                 //
916                 //--------------------------- test case core-0017C ---------------------------
917                 // Testing feature - The "replaceData(offset,count,arg)" method replace the
918                 //                   characters starting at the specified 16-bit units with the
919                 //                   specified string.  Test for replacement in the
920                 //                   middle of the data.
921                 //
922                 // Testing approach - Retrieve the character data from the last child of the
923                 //                    first employee.  The "replaceData(offset,count,arg)"
924                 //                    method is then called with offset = 5 and count = 5 and
925                 //                    arg = "South".  The method should replace characters
926                 //                    five thru nine of the character data with "South".
927                 //
928                 // Semantic Requirements: 11
929                 //
930                 //----------------------------------------------------------------------------
931
932                 [Test]
933                 public void core0017C()
934                 {
935                         string computedValue = "";
936                         string expectedValue = "1230 South Ave. Dallas, Texas 98551";
937                         System.Xml.XmlNode testNode = null;
938                         System.Xml.XmlCharacterData testNodeData = null;
939
940                         testResults results = new testResults("Core0017C");
941                         try
942                         {
943                                 results.description = "Replace a character string in the middle of character data.";
944                                 //
945                                 // Retrieve the targeted data and invoke its "replaceData" method.
946                                 //
947                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
948                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
949                                 testNodeData.ReplaceData(5,5,"South");
950                                 computedValue = testNodeData.Data;
951                         }
952                         catch(System.Exception ex)
953                         {
954                                 computedValue = "Exception " + ex.Message;
955                         }
956
957                         //
958                         // Write out results
959                         //
960                         results.expected = expectedValue;
961                         results.actual = computedValue;
962
963                         util.resetData();
964
965                         Assert.AreEqual (results.expected, results.actual);
966                 }
967
968                 //------------------------ End test case core-0017C --------------------------
969                 //
970                 //--------------------------- test case core-0018C ---------------------------
971                 //
972                 // Testing feature - The "replaceData(offset,count,arg)" method replace the
973                 //                   characters starting at the specified 16-bit units with the
974                 //                   specified string.  Test for replacement at the
975                 //                   end of the data.
976                 //
977                 // Testing approach - Retrieve the character data from the last child of the
978                 //                    first employee.  The "replaceData(offset,count,arg)"
979                 //                    method is then called with offset = 30 and count = 5 and
980                 //                    arg = "98665".  The method should replace characters
981                 //                    30 thru 34 of the character data with "98665".
982                 //
983                 // Semantic Requirements: 11
984                 //
985                 //----------------------------------------------------------------------------
986
987                 [Test]
988                 public void core0018C()
989                 {
990                         string computedValue = "";//0;
991                         string expectedValue = "1230 North Ave. Dallas, Texas 98665";
992                         System.Xml.XmlNode testNode = null;
993                         System.Xml.XmlCharacterData testNodeData = null;
994
995                         testResults results = new testResults("Core0018C");
996                         try
997                         {
998                                 results.description = "Replace a character substring at the end of character data.";
999                                 //
1000                                 // Retrieve the targeted data and invoke its "replaceData" method.
1001                                 //
1002                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
1003                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
1004                                 testNodeData.ReplaceData(30,5,"98665");
1005                                 computedValue = testNodeData.Data;
1006                         }
1007                         catch(System.Exception ex)
1008                         {
1009                                 computedValue = "Exception " + ex.Message;
1010                         }
1011
1012                         //
1013                         // Write out results
1014                         //
1015                         results.expected = expectedValue;
1016                         results.actual = computedValue;
1017
1018                         util.resetData();
1019
1020                         Assert.AreEqual (results.expected, results.actual);
1021                 }
1022
1023                 //------------------------ End test case core-0018C --------------------------
1024                 //
1025                 //--------------------------- test case core-0019C ---------------------------
1026                 //
1027                 // Testing feature - The "replaceData(offset,count,arg)" method replace the
1028                 //                   characters starting at the specified 16-bit units with the
1029                 //                   specified string.  Test situation where the length of
1030                 //                   the arg string is greater than the specified offset.
1031                 //
1032                 // Testing approach - Retrieve the character data from the last child of the
1033                 //                    first employee.  The "replaceData(offset,count,arg)"
1034                 //                    method is then called with offset = 0 and count = 4 and
1035                 //                    arg = "260030".  The method should replace characters
1036                 //                    one thru four with the string "260030".  Note that the
1037                 //                    length of the specified string is greater than the
1038                 //                    specified offset. 
1039                 //
1040                 // Semantic Requirements: 11
1041                 //
1042                 //----------------------------------------------------------------------------
1043
1044                 [Test]
1045                 public void core0019C()
1046                 {
1047                         string computedValue = "";
1048                         string expectedValue = "260030 North Ave. Dallas, Texas 98551";
1049                         System.Xml.XmlNode testNode = null;
1050                         System.Xml.XmlCharacterData testNodeData = null;
1051    
1052                         testResults results = new testResults("Core0019C");
1053                         try
1054                         {
1055                                 results.description = "Checks \"replaceData(offset,count,arg)\" method when " +
1056                                         "length of arg > count.";
1057                                 //
1058                                 // Retrieve targeted data and invoke its "replaceData" method.
1059                                 //
1060                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
1061                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
1062                                 testNodeData.ReplaceData(0,4,"260030");
1063                                 computedValue = testNodeData.Data;
1064                         }
1065                         catch(System.Exception ex)
1066                         {
1067                                 computedValue = "Exception " + ex.Message;
1068                         }
1069
1070                         //
1071                         // Write out results
1072                         //
1073                         results.expected = expectedValue;
1074                         results.actual = computedValue;
1075
1076                         util.resetData();
1077
1078                         Assert.AreEqual (results.expected, results.actual);
1079                 }
1080
1081                 //------------------------ End test case core-0019C --------------------------
1082                 //
1083                 //--------------------------- test case core-0020C ---------------------------
1084                 //
1085                 // Testing feature - If the sum of offset and count exceeds length then all 
1086                 //                   the 16-bit units to the end of data are replaced. 
1087                 //
1088                 // Testing approach - Retrieve the character data from the last child of the
1089                 //                    first employee.  The "replaceData(offset,count,arg)"
1090                 //                    method is then called with offset = 0 and count = 50 and
1091                 //                    arg = "2600".  The method should replace all the
1092                 //                    characters in the character data with "2600".  This
1093                 //                    is because the sum of offset and count exceeds the
1094                 //                    length of the character data. 
1095                 //
1096                 // Semantic Requirements: 12
1097                 //
1098                 //----------------------------------------------------------------------------
1099
1100                 [Test]
1101                 public void core0020C()
1102                 {
1103                         //string testName = "core-0020C";
1104                         string computedValue = "";
1105                         string expectedValue = "2600";
1106                         System.Xml.XmlNode testNode = null;
1107                         System.Xml.XmlCharacterData testNodeData = null;
1108
1109                         testResults results = new testResults("Core0020C");
1110                         try
1111                         {
1112                                 results.description = "If the sum of offset and count exceeds the length " +
1113                                         "of the character data then the \"replaceData(offset,count,arg)\" " +
1114                                         "method replaces all the 16-bit units to the end of the data.";
1115                                 //
1116                                 // Retrieve the targeted data and invoke its "replaceData" method.
1117                                 //
1118                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
1119                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
1120                                 testNodeData.ReplaceData(0,50,"2600");
1121                                 computedValue = testNodeData.Data;
1122                         }
1123                         catch(System.Exception ex)
1124                         {
1125                                 computedValue = "Exception " + ex.Message;
1126                         }
1127
1128                         //
1129                         // Write out results
1130                         //
1131                         results.expected = expectedValue;
1132                         results.actual = computedValue;
1133
1134                         util.resetData();
1135
1136                         Assert.AreEqual (results.expected, results.actual);
1137                 }
1138
1139                 //------------------------ End test case core-0020C --------------------------
1140                 //
1141                 //--------------------------- test case core-0021C ---------------------------
1142                 //
1143                 // Testing feature - The "data" attribute raises a 
1144                 //                   NO_MODIFICATION_ALLOWED_ERR Exception when 
1145                 //                   this node is readonly.
1146                 //
1147                 // Testing approach - Retrieve the character data from the first
1148                 //                    EntityReference node of the last child of the second
1149                 //                    employee and attempt to set its "data" attribute.  Since
1150                 //                    the the descendants of EntityReference nodes are readonly,
1151                 //                    the desired exception should be raised.
1152                 //
1153                 // Semantic Requirements: 13
1154                 //
1155                 //----------------------------------------------------------------------------
1156
1157                 [Test]
1158                 [Category ("NotDotNet")] // MS DOM is buggy
1159                 public void core0021C()
1160                 {
1161                         string computedValue = "";
1162                         System.Xml.XmlNode testNode = null;
1163                         System.Xml.XmlText readOnlyText = null;
1164                         string expectedValue = "System.ArgumentException";//util.NO_MODIFICATION_ALLOWED_ERR;
1165
1166                         testResults results = new testResults("Core0021C");
1167                         try
1168                         {
1169                                 results.description = "The \"data\" attribute raises a NO_MODIFICATION_ALLOWED_ERR " +
1170                                         "DOMException when this node is readonly.";
1171                                 //
1172                                 // Retrieve targeted data.
1173                                 //
1174                                 testNode = util.nodeObject(util.SECOND,util.SIXTH);
1175                                 readOnlyText = (System.Xml.XmlText)testNode.FirstChild.FirstChild;
1176                                 //
1177                                 // Attempt to modify the "data" attribute should raise exception. 
1178                                 //
1179                                 try 
1180                                 {
1181                                         readOnlyText.Data = "ABCD";
1182                                 }
1183                                 catch (ArgumentException ex) 
1184                                 {
1185                                         computedValue = ex.GetType ().FullName; 
1186                                 }
1187                         }
1188                         catch(InvalidOperationException ex)
1189                         {
1190                                 computedValue = "Exception " + ex.Message;
1191                         }
1192
1193                         results.expected = expectedValue;
1194                         results.actual = computedValue;
1195
1196                         util.resetData();
1197
1198                         Assert.AreEqual (results.expected, results.actual);
1199                 }
1200
1201                 //------------------------ End test case core-0021C --------------------------
1202                 //
1203                 //--------------------------- test case core-0022C ---------------------------
1204                 //
1205                 // Testing feature - The "appendData(arg) method raises a
1206                 //                   NO_MODIFICATION_ALLOWED_ERR Exception when
1207                 //                   this node is readonly.
1208                 //
1209                 // Testing approach - Retrieve the textual data from the the first
1210                 //                    EntityReference node of the last child of the
1211                 //                    second employee and attempt to append data to it.  
1212                 //                    Descendants of EntityReference nodes are readonly 
1213                 //                    nodes and therefore the desired exception should be
1214                 //                    raised.
1215                 //
1216                 // Semantic Requirements: 14
1217                 //
1218                 //----------------------------------------------------------------------------
1219
1220                 [Test]
1221                 [Category ("NotDotNet")] // MS DOM is buggy
1222                 public void core0022C()
1223                 {
1224                         string computedValue = "";
1225                         System.Xml.XmlNode testNode = null;
1226                         System.Xml.XmlCharacterData readOnlyNode = null;
1227                         string expectedValue = "System.ArgumentException";//util.NO_MODIFICATION_ALLOWED_ERR;
1228
1229                         testResults results = new testResults("Core0022C");
1230                         try
1231                         {
1232                                 results.description = "The \"appendData(arg)\" method raises a " +
1233                                         "NO_MODIFICATION_ALLOWED_ERR Exception when this " +
1234                                         "node is readonly.";
1235                                 //
1236                                 // Retrieve the targeted data.
1237                                 //
1238                                 testNode = util.nodeObject(util.SECOND,util.SIXTH);
1239                                 readOnlyNode = (System.Xml.XmlCharacterData)testNode.FirstChild.FirstChild;
1240                                 //
1241                                 // Attempt to append data to a readonly node should raise an exception. 
1242                                 //
1243                                 try 
1244                                 {
1245                                         readOnlyNode.AppendData("002");
1246                                 }
1247                                 catch(ArgumentException ex) 
1248                                 {
1249                                         computedValue = ex.GetType ().FullName; 
1250                                 }
1251                         }
1252                         catch(System.Exception ex)
1253                         {
1254                                 computedValue = "Exception " + ex.Message;
1255                         }
1256
1257                         results.expected = expectedValue;
1258                         results.actual = computedValue;
1259
1260                         util.resetData();
1261
1262                         Assert.AreEqual (results.expected, results.actual);
1263                 }
1264
1265                 //------------------------ End test case core-0022C --------------------------
1266                 //
1267                 //--------------------------- test case core-0023C ---------------------------
1268                 //
1269                 // Testing feature - The "insertData(offset,arg) method raises a
1270                 //                   NO_MODIFICATION_ALLOWED_ERR Exception when
1271                 //                   this node is readonly.
1272                 //
1273                 // Testing approach - Retrieve the Text data of the first EntityReference
1274                 //                    node from the last child of the second employee and 
1275                 //                    attempt to insert data into it.  Since the descendants
1276                 //                    of EntityReference nodes are readonly, the desired
1277                 //                    exception should be raised.
1278                 //
1279                 // Semantic Requirements: 15
1280                 //
1281                 //----------------------------------------------------------------------------
1282
1283                 [Test]
1284                 [Category ("NotDotNet")] // MS DOM is buggy
1285                 public void core0023C()
1286                 {
1287                         string computedValue = "";
1288                         System.Xml.XmlNode testNode = null;
1289                         System.Xml.XmlCharacterData readOnlyNode = null;
1290                         string expectedValue = "System.ArgumentException";//util.NO_MODIFICATION_ALLOWED_ERR;
1291
1292                         testResults results = new testResults("Core0023C");
1293                         try
1294                         {
1295                                 results.description = "The \"insertData(offset,arg)\" method raises a " +
1296                                         "NO_MODIFICATION_ALLOWED_ERR Exception when this " +
1297                                         "node is readonly.";
1298                                 //
1299                                 // Retrieve the targeted data
1300                                 //
1301                                 testNode = util.nodeObject(util.SECOND,util.SIXTH);
1302                                 readOnlyNode = (System.Xml.XmlCharacterData)testNode.FirstChild.FirstChild;
1303                                 //
1304                                 // Attempt to insert data into a readonly node should raise an exception.
1305                                 //
1306                                 try 
1307                                 {
1308                                         readOnlyNode.InsertData(2,"ABCD");
1309                                 }
1310                                 catch(ArgumentException ex) 
1311                                 {
1312                                         computedValue = ex.GetType ().FullName; 
1313                                 }
1314                         }
1315                         catch(System.Exception ex)
1316                         {
1317                                 computedValue = "Exception " + ex.Message;
1318                         }
1319
1320                         results.expected = expectedValue;
1321                         results.actual = computedValue;
1322
1323                         util.resetData();
1324
1325                         Assert.AreEqual (results.expected, results.actual);
1326                 }
1327
1328                 //------------------------ End test case core-0023C --------------------------
1329                 //
1330                 //--------------------------- test case core-0024C ---------------------------
1331                 //
1332                 // Testing feature - The "deleteData(offset,count) method raises a
1333                 //                   NO_MODIFICATION_ALLOWED_ERR Exception when
1334                 //                   ths is readonly.
1335                 //
1336                 // Testing approach - Retrieve the textual data of the the first
1337                 //                    EntityReference node from the last child of the
1338                 //                    second employee and attempt to delete data from it.  
1339                 //                    Since the descendants of EntityReference nodes are 
1340                 //                    readonly, the desired exception should be raised.
1341                 //
1342                 // Semantic Requirements: 16
1343                 //
1344                 //----------------------------------------------------------------------------
1345
1346                 [Test]
1347                 [Category ("NotDotNet")] // MS DOM is buggy
1348                 public void core0024C()
1349                 {
1350                         string computedValue = "";
1351                         System.Xml.XmlCharacterData readOnlyNode = null;
1352                         System.Xml.XmlNode testNode = null;
1353                         string expectedValue = "System.ArgumentException";//util.NO_MODIFICATION_ALLOWED_ERR;
1354
1355                         testResults results = new testResults("Core0024C");
1356                         try
1357                         {
1358                                 results.description = "The \"deleteData(offset,count)\" method raises a " +
1359                                         "NO_MODIFICATION_ALLOWED_ERR Exception when this " +
1360                                         "node is readonly.";
1361                                 //
1362                                 // Retrieve the targeted data. 
1363                                 //
1364                                 testNode = util.nodeObject(util.SECOND,util.SIXTH); 
1365                                 readOnlyNode = (System.Xml.XmlCharacterData)testNode.FirstChild.FirstChild;
1366                                 //
1367                                 // Attempt to delete data from a readonly node should raise an
1368                                 // exception.
1369                                 //
1370                                 try 
1371                                 {
1372                                         readOnlyNode.DeleteData(2,4);
1373                                 }
1374                                 catch(System.Exception ex) 
1375                                 {
1376                                         computedValue = ex.GetType ().FullName; 
1377                                 }
1378                         }
1379                         catch(System.Exception ex)
1380                         {
1381                                 computedValue = "Exception " + ex.Message;
1382                         }
1383
1384                         results.expected = expectedValue;
1385                         results.actual = computedValue;
1386
1387                         util.resetData();
1388
1389                         Assert.AreEqual (results.expected, results.actual);
1390                 }
1391
1392                 //------------------------ End test case core-0024C --------------------------
1393                 //
1394                 //--------------------------- test case core-0025C ---------------------------
1395                 //
1396                 // Testing feature - The "replaceData(offset,count,arg) method raises a
1397                 //                   NO_MODIFICATION_ALLOWED_ERR Exception when
1398                 //                   this node is readonly.
1399                 //
1400                 // Testing approach - Retrieve the textual data of the first EntityReference
1401                 //                    node from the last child of the second employee and
1402                 //                    attempt to replace data from it.  Since the descendants
1403                 //                    of EntityReference nodes are readonly, the desired 
1404                 //                    exception should be raised.
1405                 //
1406                 // Semantic Requirements: 17
1407                 //
1408                 //----------------------------------------------------------------------------
1409
1410                 [Test]
1411                 [Category ("NotDotNet")] // MS DOM is buggy
1412                 public void core0025C()
1413                 {
1414                         string computedValue = "";
1415                         System.Xml.XmlCharacterData readOnlyNode = null;
1416                         System.Xml.XmlNode testNode = null;
1417                         string expectedValue = "System.ArgumentException";//util.NO_MODIFICATION_ALLOWED_ERR;
1418
1419                         testResults results = new testResults("Core0025C");
1420                         try
1421                         {
1422                                 results.description = "The \"replaceData(offset,count,arg)\" method raises a " +
1423                                         "NO_MODIFICATION_ALLOWED_ERR Exception " +
1424                                         "when this node is readonly.";
1425                                 //
1426                                 // Retrieve the targeted data.
1427                                 //
1428                                 testNode = util.nodeObject(util.SECOND,util.SIXTH);
1429                                 readOnlyNode = (System.Xml.XmlCharacterData)testNode.FirstChild.FirstChild;
1430                                 //
1431                                 // Attempt to replace data from a readonly node should raise an
1432                                 // exception.
1433                                 //
1434                                 try 
1435                                 {
1436                                         readOnlyNode.ReplaceData(2,4,"ABCD");
1437                                 }
1438                                 catch(System.Exception ex) 
1439                                 {
1440                                         computedValue = ex.GetType ().FullName; 
1441                                 }
1442                         }
1443                         catch(System.Exception ex)
1444                         {
1445                                 computedValue = "Exception " + ex.Message;
1446                         }
1447
1448                         results.expected = expectedValue;
1449                         results.actual = computedValue;
1450
1451                         util.resetData();
1452
1453                         Assert.AreEqual (results.expected, results.actual);
1454                 }
1455
1456                 //------------------------ End test case core-0025C --------------------------
1457                 //
1458                 //--------------------------- test case core-0026C ---------------------------
1459                 //
1460                 // Testing feature - The "substringData(offset,count)" method raises an 
1461                 //                   INDEX_SIZE_ERR Exception if the specified offset is
1462                 //                   negative.
1463                 //
1464                 // Testing approach - Retrieve the character data of the last child of the
1465                 //                    of the first employee and invoke its 
1466                 //                    "substringData(offset,count)" method with offset = -5
1467                 //                    count = 3.  It should raise the desired exception since
1468                 //                    the offset is negative.
1469                 //
1470                 // Semantic Requirements: 19
1471                 //
1472                 //----------------------------------------------------------------------------
1473
1474                 [Test]
1475                 public void core0026C()
1476                 {
1477                         string computedValue = "";
1478                         string returnedValue = "";
1479                         System.Xml.XmlNode testNode = null;
1480                         System.Xml.XmlCharacterData testNodeData = null;
1481                         string expectedValue = "System.ArgumentOutOfRangeException";//util.INDEX_SIZE_ERR;
1482
1483                         testResults results = new testResults("Core0026C");
1484                         try
1485                         {
1486                                 results.description = "The \"substringData(offset,count)\" method raises an " +
1487                                         "INDEX_SIZE_ERR Exception if the specified " +
1488                                         "offset is negative.";
1489                                 //
1490                                 // Retrieve the targeted data.
1491                                 //
1492                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
1493                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;  
1494                                 //
1495                                 // A negative offset value should raise and exception.
1496                                 //
1497                                 try 
1498                                 {
1499                                         returnedValue = testNodeData.Substring(-5,3); 
1500                                 }
1501                                 catch(System.Exception ex) 
1502                                 {
1503                                         computedValue = ex.GetType ().FullName; 
1504                                 }
1505                         }
1506                         catch(System.Exception ex)
1507                         {
1508                                 computedValue = "Exception " + ex.Message;
1509                         }
1510
1511                         results.expected = expectedValue;
1512                         results.actual = computedValue;
1513
1514                         Assert.AreEqual (results.expected, results.actual);
1515                 }
1516
1517                 //------------------------ End test case core-0026C --------------------------
1518                 //
1519                 //--------------------------- test case core-0027C ---------------------------
1520                 //
1521                 // Testing feature - The "substringData(offset,count)" method raises an
1522                 //                   INDEX_SIZE_ERR Exception if the specified offset is
1523                 //                   greater than the number of 16-bit units in the "data"
1524                 //                   attribute. 
1525                 //
1526                 // Testing approach - Retrieve the character data of the last child of the
1527                 //                    first employee and invoke its 
1528                 //                    "substringData(offset,count)" method with offset = 40 and 
1529                 //                    count = 3.  The value of the offset is greater than that
1530                 //                    one of the "data" attribute, therefore the desired 
1531                 //                    exception should be raised.
1532                 //
1533                 // Semantic Requirements: 20 
1534                 //
1535                 //----------------------------------------------------------------------------
1536
1537                 [Test]
1538                 public void core0027C()
1539                 {
1540                         string computedValue = "";
1541                         string returnedValue = "";
1542                         System.Xml.XmlNode testNode = null;
1543                         System.Xml.XmlCharacterData testNodeData = null;
1544                         string expectedValue = "System.ArgumentOutOfRangeException";
1545
1546                         testResults results = new testResults("Core0027C");
1547                         try
1548                         {
1549                                 results.description = "The \"substringData(offset,count)\" method raises an " +
1550                                         "ArgumentOutOfRangeException Exception if the specified " +
1551                                         "offset is greater than the number of 16-bit units " +
1552                                         "in the \"data\" attribute.";
1553                                 //
1554                                 // Retrieve the targeted data.
1555                                 //
1556                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
1557                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
1558                                 //
1559                                 // Offset greater than number of characters in data should raise an
1560                                 // exception.
1561                                 //
1562                                 try 
1563                                 {
1564                                         returnedValue = testNodeData.Substring(40,3);
1565                                 }
1566                                 catch(System.Exception ex) 
1567                                 {
1568                                         computedValue = ex.GetType().ToString();
1569                                 }
1570                         }
1571                         catch(System.Exception ex)
1572                         {
1573                                 computedValue = "Exception " + ex.Message;
1574                         }
1575                         results.expected = expectedValue;
1576                         results.actual = computedValue;
1577
1578                         Assert.AreEqual (results.expected, results.actual);
1579                 }
1580
1581                 //------------------------ End test case core-0027C --------------------------
1582                 //
1583                 //--------------------------- test case core-0028C ---------------------------
1584                 //
1585                 // Testing feature - The "substringData(offset,count)" method raises an
1586                 //                   INDEX_SIZE_ERR Exception if the count is negative 
1587                 //
1588                 // Testing approach - Retrieve the character data of the last child of the
1589                 //                    first employee and invoke its
1590                 //                    "substringData(offset,count)" method with offset = 10
1591                 //                    and count = -3.  Since the value of count is negative,
1592                 //                    the desired exception should be raised.
1593                 //
1594                 // Semantic Requirements: 21 
1595                 //
1596                 //----------------------------------------------------------------------------
1597
1598                 [Test]
1599                 public void core0028C()
1600                 {
1601                         string computedValue = "";
1602                         string returnedValue = "";
1603                         System.Xml.XmlNode testNode = null;
1604                         System.Xml.XmlCharacterData testNodeData = null;
1605                         string expectedValue = "System.ArgumentOutOfRangeException";
1606
1607                         testResults results = new testResults("Core0028C");
1608                         try
1609                         {
1610                                 results.description = "The \"substringData(offset,count)\" method raises an " +
1611                                         "INDEX_SIZE_ERR Exception if the count is negative.";
1612                                 //
1613                                 // Retrieve the targeted data.
1614                                 //
1615                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
1616                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
1617                                 //
1618                                 // A negative value for "count" should raise an exception.
1619                                 //
1620                                 try 
1621                                 {
1622                                         returnedValue = testNodeData.Substring(10,-3);
1623                                 }
1624                                 catch(System.Exception ex) 
1625                                 {
1626                                         computedValue = ex.GetType().ToString();
1627                                 }
1628                         }
1629                         catch(System.Exception ex)
1630                         {
1631                                 computedValue = "Exception " + ex.Message;
1632                         }
1633                         results.expected = expectedValue;
1634                         results.actual = computedValue;
1635
1636                         Assert.AreEqual (results.expected, results.actual);
1637                 }
1638
1639                 //------------------------ End test case core-0028C --------------------------
1640                 //
1641                 //--------------------------- test case core-0029C ---------------------------
1642                 //
1643                 // Testing feature - The "deleteData(offset,count)" method raises an
1644                 //                   ArgumentOutOfRangeException if the specified offset is
1645                 //                   negative.
1646                 //
1647                 // Testing approach - Retrieve the character data of the last child of the
1648                 //                    first employee and invoke its "deleteData(offset,count)"
1649                 //                    method with offset = -5 and count = 3.  The value of the
1650                 //                    offset is negative and therefore the desired exception
1651                 //                    should be raised.
1652                 //
1653                 // Semantic Requirements: 22 
1654                 //
1655                 //----------------------------------------------------------------------------
1656
1657                 [Test]
1658                 public void core0029C()
1659                 {
1660                         string computedValue = "";
1661                         System.Xml.XmlNode testNode = null;
1662                         System.Xml.XmlCharacterData testNodeData = null;
1663                         string expectedValue = "System.ArgumentOutOfRangeException";
1664
1665                         testResults results = new testResults("Core0029C");
1666                         try
1667                         {
1668                                 results.description = "The \"deleteData(offset,count)\" method raises an " +
1669                                         "ArgumentOutOfRangeException if the specified " +
1670                                         "offset is negative.";
1671                                 //
1672                                 // Retrieve the targeted data.
1673                                 //
1674                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
1675                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
1676                                 //
1677                                 // Invoke "deleteData(offset,count)" method with negative offset should
1678                                 // should raise an excetion.
1679                                 //
1680                                 try 
1681                                 {
1682                                         testNodeData.DeleteData(-5,3);
1683                                 }
1684                                 catch(System.Exception ex) 
1685                                 {
1686                                         computedValue = ex.GetType().ToString();
1687                                 }
1688                         }
1689                         catch(System.Exception ex)
1690                         {
1691                                 computedValue = "Exception " + ex.Message;
1692                         }
1693                         results.expected = expectedValue;
1694                         results.actual = computedValue;
1695
1696                         util.resetData();
1697
1698                         Assert.AreEqual (results.expected, results.actual);
1699                 }
1700
1701                 //------------------------ End test case core-0029C --------------------------
1702                 //
1703                 //--------------------------- test case core-0030C ---------------------------
1704                 //
1705                 // Testing feature - The "deleteData(offset,count)" method raises an
1706                 //                   ArgumentOutOfRangeException if the specified offset is
1707                 //                   greater than the number of characters in the "data"
1708                 //                   attribute.
1709                 //
1710                 // Testing approach - Retrieve the character data of the last child of the
1711                 //                    first employee and invoke its "deleteData(offset,count)"
1712                 //                    method with offset = 40 and count = 3.  The value of the
1713                 //                    offset is greater than the number of characters in the
1714                 //                    "data" attribute (35) and therefore the intended 
1715                 //                    exception should be raised.
1716                 //
1717                 // Semantic Requirements: 23 
1718                 //
1719                 //----------------------------------------------------------------------------
1720
1721                 [Test]
1722                 public void core0030C()
1723                 {
1724                         string computedValue = "";
1725                         System.Xml.XmlNode testNode = null;
1726                         System.Xml.XmlCharacterData testNodeData = null;
1727                         string expectedValue = "System.ArgumentOutOfRangeException";
1728
1729                         testResults results = new testResults("Core0030C");
1730                         try
1731                         {
1732                                 results.description = "The \"deleteData(offset,count)\" method raises an " +
1733                                         "ArgumentOutOfRangeException if the specified " +
1734                                         "offset is greater than the number of characters " +
1735                                         "in the \"data\" attribute.";
1736                                 //
1737                                 // Retrieve the targeted data.
1738                                 //
1739                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
1740                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
1741                                 //
1742                                 // Invocation of "deleteData(offset,count)" method with offset > data
1743                                 // attribute should raise and exception.
1744                                 //
1745                                 try 
1746                                 {
1747                                         testNodeData.DeleteData(40,3);
1748                                 }
1749                                 catch(System.Exception ex) 
1750                                 {
1751                                         computedValue = ex.GetType().ToString(); 
1752                                 }
1753                         }
1754                         catch(System.Exception ex)
1755                         {
1756                                 computedValue = "Exception " + ex.Message;
1757                         }
1758
1759                         results.expected = expectedValue;
1760                         results.actual = computedValue;
1761
1762                         util.resetData();
1763
1764                         Assert.AreEqual (results.expected, results.actual);
1765                 }
1766
1767                 //------------------------ End test case core-0030C --------------------------
1768                 //
1769                 //--------------------------- test case core-0031C ---------------------------
1770                 //
1771                 // Testing feature - The "deleteData(offset,count)" method raises an
1772                 //                   ArgumentOutOfRangeException if the specified count is
1773                 //                   negative.
1774                 //
1775                 // Testing approach - Retrieve the character data of the last child of the
1776                 //                    first employee and invoke its "deleteData(offset,count)" 
1777                 //                    method with offset = 10 and count = -3.  The value
1778                 //                    of the specified count is negative and therefore the
1779                 //                    intended exception should be raised.
1780                 //
1781                 // Semantic Requirements: 24 
1782                 //
1783                 //----------------------------------------------------------------------------
1784
1785                 [Test]
1786                 public void core0031C()
1787                 {
1788                         string computedValue = "";
1789                         System.Xml.XmlNode testNode = null;
1790                         System.Xml.XmlCharacterData testNodeData = null;
1791                         string expectedValue = "System.ArgumentOutOfRangeException";
1792
1793                         testResults results = new testResults("Core0031C");
1794                         try
1795                         {
1796                                 results.description = "The \"deleteData(offset,count)\" method raises an " +
1797                                         "ArgumentOutOfRangeException if the specified " +
1798                                         "count is negative.";
1799                                 //
1800                                 // Retrieve the targeted data.
1801                                 //
1802                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
1803                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
1804                                 //
1805                                 // Invocation of "deleteData(offset,count)" method with count < 0 
1806                                 // should raise and exception. 
1807                                 //
1808                                 try 
1809                                 {
1810                                         testNodeData.DeleteData(10,-3);
1811                                 }
1812                                 catch(System.Exception ex) 
1813                                 {
1814                                         computedValue = ex.GetType().ToString();
1815                                 }
1816                         }
1817                         catch(System.Exception ex)
1818                         {
1819                                 computedValue = "Exception " + ex.Message;
1820                         }
1821
1822                         results.expected = expectedValue;
1823                         results.actual = computedValue;
1824
1825                         util.resetData();
1826
1827                         Assert.AreEqual (results.expected, results.actual);
1828                 }
1829
1830                 //------------------------ End test case core-0031C --------------------------
1831                 //
1832                 //--------------------------- test case core-0032C ---------------------------
1833                 //
1834                 // Testing feature - The "replaceData(offset,count,arg)" method raises an
1835                 //                   ArgumentOutOfRangeException if the specified offset is
1836                 //                   negative.
1837                 //
1838                 // Testing approach - Retrieve the character data of the last child of the
1839                 //                    first employee and invoke its 
1840                 //                    "replaceData(offset,count,arg)" method with 
1841                 //                    offset = -5 and count = 3 and arg = "ABC".  The value 
1842                 //                    of the offset is negative and therefore the desired 
1843                 //                    exception should be raised.
1844                 //
1845                 // Semantic Requirements: 25
1846                 //
1847                 //----------------------------------------------------------------------------
1848
1849                 [Test]
1850                 public void core0032C()
1851                 {
1852                         string computedValue = "";
1853                         System.Xml.XmlNode testNode = null;
1854                         System.Xml.XmlCharacterData testNodeData = null;
1855                         string expectedValue = "System.ArgumentOutOfRangeException";
1856
1857                         testResults results = new testResults("Core0032C");
1858                         try
1859                         {
1860                                 results.description = "The \"replaceData(offset,count,arg)\" method raises an " +
1861                                         "ArgumentOutOfRangeException if the specified " +
1862                                         "offset is negative.";
1863                                 //
1864                                 // Retrieve the targeted data.
1865                                 //
1866                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
1867                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
1868                                 //
1869                                 // Invocation of "replaceData(offset,count,arg)" method offset < 0
1870                                 // should raise an exception.
1871                                 //
1872                                 try 
1873                                 {
1874                                         testNodeData.ReplaceData(-5,3,"ABC");
1875                                 }
1876                                 catch(System.Exception ex) 
1877                                 {
1878                                         computedValue = ex.GetType().ToString();
1879                                 }
1880                         }
1881                         catch(System.Exception ex)
1882                         {
1883                                 computedValue = "Exception " + ex.Message;
1884                         }
1885
1886                         results.expected = expectedValue;
1887                         results.actual = computedValue;
1888
1889                         util.resetData();
1890
1891                         Assert.AreEqual (results.expected, results.actual);
1892                 }
1893
1894                 //------------------------ End test case core-0032C --------------------------
1895                 //
1896                 //--------------------------- test case core-0033C ---------------------------
1897                 //
1898                 // Testing feature - The "replaceData(offset,count,arg)" method raises an
1899                 //                   INDEX_RANGE_ERR Exception if the specified offset is
1900                 //                   greater than the number of 16-bit units in the "data"
1901                 //                   attribute.
1902                 //
1903                 // Testing approach - Retrieve the character data of the last child of the
1904                 //                    first employee and invoke its 
1905                 //                    "replaceData(offset,count,arg)" method with offset = 40,
1906                 //                    count = 3 and arg = "ABC".  The value of the offset is 
1907                 //                    greater than the number of characters in the "data" 
1908                 //                    attribute (35) and therefore the intended exception 
1909                 //                    should be raised.
1910                 //
1911                 // Semantic Requirements: 26
1912                 //
1913                 //----------------------------------------------------------------------------
1914
1915                 [Test]
1916                 public void core0033C()
1917                 {
1918                         string computedValue = "";
1919                         System.Xml.XmlNode testNode = null;
1920                         System.Xml.XmlCharacterData testNodeData = null;
1921                         string expectedValue = "System.ArgumentOutOfRangeException";
1922
1923                         testResults results = new testResults("Core0033C");
1924                         try
1925                         {
1926                                 results.description = "The \"replaceData(offset,count,arg)\" method raises an " +
1927                                         "ArgumentOutOfRangeException if the specified " +
1928                                         "offset is greater than the number of 16-bit units " +
1929                                         "in the \"data\" attribute.";
1930                                 //
1931                                 // Retrieve the targeted data.
1932                                 //
1933                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
1934                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
1935                                 //
1936                                 // Invocation of "replaceData(offset,count,arg)" method with offset > data  
1937                                 // attribute should raise and exception.
1938                                 //
1939                                 try 
1940                                 {
1941                                         testNodeData.ReplaceData(40,3,"ABC");
1942                                 }
1943                                 catch(System.Exception ex) 
1944                                 {
1945                                         computedValue = ex.GetType().ToString();
1946                                 }
1947                         }
1948                         catch(System.Exception ex)
1949                         {
1950                                 computedValue = "Exception " + ex.Message;
1951                         }
1952
1953                         results.expected = expectedValue;
1954                         results.actual = computedValue;
1955
1956                         util.resetData();
1957
1958                         Assert.AreEqual (results.expected, results.actual);
1959                 } 
1960
1961                 //------------------------ End test case core-0033C --------------------------
1962                 //
1963                 //--------------------------- test case core-0034C ---------------------------
1964                 //
1965                 // Testing feature - The "replaceData(offset,count,arg)" method raises an
1966                 //                   ArgumentOutOfRangeException if the specified count is
1967                 //                   negative.
1968                 //
1969                 // Testing approach - Retrieve the character data of the last child of the
1970                 //                    first employee and invoke its 
1971                 //                    "replaceData(offset,count,arg)" method with offset = 10,
1972                 //                    count = -3 and arg = "ABC".  The value of the specified 
1973                 //                    count is negative and therefore the intended exception 
1974                 //                    should be raised.
1975                 //
1976                 // Semantic Requirements: 27
1977                 //
1978                 //----------------------------------------------------------------------------
1979
1980                 [Test]
1981                 public void core0034C()
1982                 {
1983                         string computedValue = "";
1984                         System.Xml.XmlNode testNode = null;
1985                         System.Xml.XmlCharacterData testNodeData = null;
1986                         string expectedValue = "System.ArgumentOutOfRangeException";
1987
1988                         testResults results = new testResults("Core0034C");
1989                         try
1990                         {
1991                                 results.description = "The \"replaceData(offset,count,arg)\" method raises an " +
1992                                         "ArgumentOutOfRangeException if the specified " +
1993                                         "count is negative.";
1994                                 //
1995                                 // Retrieve the targeted data.
1996                                 //
1997                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
1998                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
1999                                 //
2000                                 // Invocation of "replaceData(offset,count,arg)" method with count < 0
2001                                 // should raise an exception.
2002                                 //
2003                                 try 
2004                                 {
2005                                         testNodeData.ReplaceData(10,-3,"ABC");
2006                                 }
2007                                 catch(System.Exception ex) 
2008                                 {
2009                                         computedValue = ex.GetType().ToString(); 
2010                                 }
2011                         }
2012                         catch(System.Exception ex)
2013                         {
2014                                 computedValue = "Exception " + ex.Message;
2015                         }
2016
2017                         results.expected = expectedValue;
2018                         results.actual = computedValue;
2019
2020                         util.resetData();
2021
2022                         Assert.AreEqual (results.expected, results.actual);
2023                 }
2024
2025                 //------------------------ End test case core-0034C --------------------------
2026                 //
2027                 //--------------------------- test case core-0035C ---------------------------
2028                 //
2029                 // Testing feature - The "insertData(offset,arg)" method raises an
2030                 //                   ArgumentOutOfRangeException if the specified offset is
2031                 //                   negative.
2032                 //
2033                 // Testing approach - Retrieve the character data from the last child of the
2034                 //                    first employee and invoke its "insertData(offset,arg)" 
2035                 //                    method with offset = -5 arg = "ABC".  The value
2036                 //                    of the offset is negative and therefore the desired
2037                 //                    exception should be raised.
2038                 //
2039                 // Semantic Requirements: 28
2040                 //
2041                 //----------------------------------------------------------------------------
2042
2043                 [Test]
2044                 public void core0035C()
2045                 {
2046                         string computedValue = "";
2047                         System.Xml.XmlNode testNode = null;
2048                         System.Xml.XmlCharacterData testNodeData = null;
2049                         string expectedValue = "System.ArgumentOutOfRangeException";
2050
2051                         testResults results = new testResults("Core0035C");
2052                         try
2053                         {
2054                                 results.description = "The \"insertData(offset,arg)\" method raises an " +
2055                                         "ArgumentOutOfRangeException if the specified offset is negative.";
2056                                 //
2057                                 // Retrieve the targeted data.
2058                                 //
2059                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
2060                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
2061                                 //
2062                                 // Invocation of insertData(offset,arg)" method with offset < 0
2063                                 // should raise an exception.
2064                                 //
2065                                 try 
2066                                 {
2067                                         testNodeData.InsertData(-5,"ABC");
2068                                 }
2069                                 catch(System.Exception ex) 
2070                                 {
2071                                         computedValue = ex.GetType().ToString();
2072                                 }
2073                         }
2074                         catch(System.Exception ex)
2075                         {
2076                                 computedValue = "Exception " + ex.Message;
2077                         }
2078
2079                         results.expected = expectedValue;
2080                         results.actual = computedValue;
2081
2082                         util.resetData();
2083
2084                         Assert.AreEqual (results.expected, results.actual);
2085                 }
2086
2087                 //------------------------ End test case core-0035C --------------------------
2088                 //
2089                 //--------------------------- test case core-0036C ---------------------------
2090                 //
2091                 // Testing feature - The "insertData(offset,arg)" method raises an
2092                 //                   ArgumentOutOfRangeException if the specified offset is
2093                 //                   greater than the number of 16-bit units in the "data"
2094                 //                   attribute.
2095                 //
2096                 // Testing approach - Retrieve the character data from the last child of the
2097                 //                    first employee and invoke its "insertData(offset,arg)" 
2098                 //                    method with offset = 40 and arg = "ABC".  The value of 
2099                 //                    the offset is greater than the number of characters in 
2100                 //                    the "data" attribute(35) and therefore the intended
2101                 //                    exception should be raised.
2102                 //
2103                 // Semantic Requirements: 29
2104                 //
2105                 //----------------------------------------------------------------------------
2106
2107                 [Test]
2108                 public void core0036C()
2109                 {
2110                         string computedValue = "";
2111                         System.Xml.XmlNode testNode = null;
2112                         System.Xml.XmlCharacterData testNodeData = null;
2113                         string expectedValue = "System.ArgumentOutOfRangeException";
2114
2115                         testResults results = new testResults("Core0036C");
2116                         try
2117                         {
2118                                 results.description = "The \"insertData(offset,arg)\" method raises an " +
2119                                         "ArgumentOutOfRangeException if the specified " +
2120                                         "offset is greater than the number of 16-bit units " +
2121                                         "in the \"data\" attribute.<br>";
2122                                 //
2123                                 // Retrieve the targeted data.
2124                                 //
2125                                 testNode = util.nodeObject(util.FIRST,util.SIXTH);
2126                                 testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
2127                                 //
2128                                 // Invocation of "insertData(offset arg)" method with offset > data 
2129                                 // attribute should raise an exception.
2130                                 //
2131                                 try 
2132                                 {
2133                                         testNodeData.InsertData(40,"ABC");
2134                                 }
2135                                 catch(System.Exception ex) 
2136                                 {
2137                                         computedValue = ex.GetType().ToString(); 
2138                                 }
2139                         }
2140                         catch(System.Exception ex)
2141                         {
2142                                 computedValue = "Exception " + ex.Message;
2143                         }
2144
2145                         results.expected = expectedValue;
2146                         results.actual = computedValue;
2147
2148                         util.resetData();
2149
2150                         Assert.AreEqual (results.expected, results.actual);
2151                 }
2152
2153                 //------------------------ End test case core-0036C --------------------------
2154         }
2155 }