1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
|
//**************************************************************************
//
//
// National Institute Of Standards and Technology
// DTS Version 1.0
//
// Attr Interface
//
// Written by: Carmelo Montanez
//
// Ported to System.Xml by: Mizrahi Rafael rafim@mainsoft.com
// Mainsoft Corporation (c) 2003-2004
//
//**************************************************************************
using System;
using System.Xml;
using nist_dom;
using NUnit.Framework;
namespace nist_dom.fundamental
{
[TestFixture]
public class AttrTest//, ITest
{
public static int i = 1;
/*
public testResults[] RunTests()
{
testResults[] tests = new testResults[] {core0001A(), core0002A(), core0003A(),core0004A(),
core0005A(), core0006A(), core0007A(), core0008A(),
core0009A(), core0010A(), core0011A(), core0012A(),
core0013A(), core0014A()};
return tests;
}
*/
//------------------------ test case core-0001A ------------------------
//
// Testing feature - The parentNode attribute for an Attr object should
// be null.
//
// Testing approach - Retrieve the attribute named "domestic" from the last
// child of of the first employee and examine its
// parentNode attribute. This test uses the
// "GetNamedItem(name)" method from the NamedNodeMap
// interface.
//
// Semantic Requirements: 1
//
//----------------------------------------------------------------------------
[Test]
public void core0001A()
{
object computedValue = null;
object expectedValue = null;
System.Xml.XmlNode testNode = null;
System.Xml.XmlAttribute domesticAttr = null;
testResults results = new testResults("Core0001A");
try
{
results.description = "The ParentNode attribute should be null for" +
" an Attr object.";
//
// Retrieve targeted data and examine parentNode attribute.
//
testNode = util.nodeObject(util.FIRST, util.SIXTH);
domesticAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("domestic");
computedValue = domesticAttr.ParentNode;
//
// Write out results
//
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
results.expected = (expectedValue == null).ToString();
results.actual = (computedValue == null).ToString();
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0001A --------------------------
//
//------------------------- test case core-0002A ----------------------------
//
//
// Written By: Carmelo Montanez
//
// Testing feature - The previousSibling attribute for an Attr object
// should be null.
//
// Testing approach - Retrieve the attribute named "domestic" from the last
// child of of the first employee and examine its
// previousSibling attribute. This test uses the
// "GetNamedItem(name)" method from the NamedNodeMap
// interface.
//
// Semantic Requirements: 1
//
//----------------------------------------------------------------------------
[Test]
public void core0002A()
{
object computedValue = null;
object expectedValue = null;
System.Xml.XmlAttribute domesticAttr = null;
System.Xml.XmlNode testNode = null;
testResults results = new testResults("Core0002A");
try
{
results.description = "The previousSibling attribute should be " +
"null for an Attr object.";
//
// Retrieve the targeted data and examine its previousSibling attribute.
//
testNode = util.nodeObject(util.FIRST,util.SIXTH);
domesticAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("domestic");
computedValue = domesticAttr.PreviousSibling;
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// Write out results
//
results.expected = (expectedValue == null).ToString();
results.actual = (computedValue == null).ToString();
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0002A --------------------------
//
//------------------------- test case core-0003A ----------------------------
// Written By: Carmelo Montanez
//
// Testing feature - The nextSibling attribute for an Attr object should
// be null.
//
// Testing approach - Retrieve the attribute named "domestic" from the
// last child of of the first employee and examine
// its nextSibling attribute. This test uses the
// "GetNamedItem(name)" method from the NamedNodeMap
// interface.
//
// Semantic Requirements: 1
//
//----------------------------------------------------------------------------
[Test]
public void core0003A()
{
object computedValue = null;
object expectedValue = null;
System.Xml.XmlAttribute domesticAttr = null;
System.Xml.XmlNode testNode = null;
testResults results = new testResults("Core0003A");
try
{
results.description = "The nextSibling attribute should be null " +
"for an Attr object.";
//
// Retrieve the targeted data and examine its nextSibling attribute.
//
testNode = util.nodeObject(util.FIRST,util.SIXTH);
domesticAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("domestic");
computedValue = domesticAttr.NextSibling;
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// Write out results
//
results.expected = (expectedValue == null).ToString();
results.actual = (computedValue == null).ToString();
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0003A --------------------------
//
//------------------------- test case core-0004A ----------------------------
//
// Written By: Carmelo Montanez
//
// Testing feature - Attr objects may be associated with Element nodes
// contained within a DocumentFragment.
//
// Testing approach - Create a new DocumentFragment object and add a newly
// created Element node to it (with one attribute). Once
// the element is added, its attribute should be available
// as an attribute associated with an Element within a
// DocumentFragment.
//
// Semantic Requirements: 2
//
//----------------------------------------------------------------------------
[Test]
public void core0004A()
{
string computedValue = "";
string expectedValue = "domestic";
System.Xml.XmlAttribute domesticAttr = null;
testResults results = new testResults("Core0004A");
try
{
results.description = "Attr objects may be associated with Element " +
"nodes contained within a DocumentFragment.";
System.Xml.XmlDocumentFragment docFragment = util.getDOMDocument().CreateDocumentFragment();
System.Xml.XmlElement newElement = (System.Xml.XmlElement)util.createNode(util.ELEMENT_NODE,"element1");
//
// The new DocumentFragment is empty upon creation. Set an attribute for
// a newly created element and add the element to the documentFragment.
//
newElement.SetAttribute("domestic","Yes");
docFragment.AppendChild(newElement);
//
// Access the attributes of the only child of the documentFragment
//
domesticAttr = (System.Xml.XmlAttribute)docFragment.FirstChild.Attributes.Item(0) ;
computedValue = domesticAttr.Name;
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
util.resetData();
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0004A --------------------------
//
//-------------------------- test case core-0005A ----------------------------
//
// Testing feature - If an Attr is explicitly assigned any value, then that
// value is the attribute's effective value.
//
// Testing approach - Retrieve the attribute name "domestic" from the last
// child of of the first employee element and examine its
// assigned value. This test uses the
// "GetNamedItem(name)" method from the NamedNodeMap
// interface.
//
// Semantic Requirements: 3
//
//----------------------------------------------------------------------------
[Test]
public void core0005A()
{
string computedValue = "";
string expectedValue = "Yes";
System.Xml.XmlAttribute domesticAttr = null;
System.Xml.XmlNode testNode = null;
testResults results = new testResults("Core0005A");
try
{
results.description = "If an attribute is explicitly assigned any value, " +
"then that value is the attribute's effective value.";
//
// Retrieve the targeted data and examine its assigned value.
//
testNode = util.nodeObject(util.FIRST,util.SIXTH);
domesticAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("domestic");
computedValue = domesticAttr.Value;
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0005A --------------------------
//
//-------------------------- test case core-0006A ----------------------------
//
// Testing feature - If there is no explicit value assigned to an attribute
// and there is a declaration for this attribute and that
// declaration includes a default value, then that default
// value is the Attribute's default value.
//
// Testing approach - Retrieve the attribute named "street" from the
// last child of of the first employee and examine its
// value. That value should be the value given during
// the declaration of the attribute in the DTD file.
// This test uses the "GetNamedItem(name)" method from
// the NamedNodeMap interface.
//
// Semantic Requirements: 4
//
//----------------------------------------------------------------------------
[Test]
#if NET_2_0
[Category ("NotDotNet")]
#endif
public void core0006A()
{
string computedValue = "";
string expectedValue = "Yes";
System.Xml.XmlAttribute streetAttr = null;
System.Xml.XmlNode testNode = null;
testResults results = new testResults("Core0006A");
try
{
results.description = "If there is no explicit value assigned to an " +
"attribute and there is a declaration for this " +
"attribute and that declaration includes a default " +
"value, then that default value is the Attribute's " +
"default value.";
//
// Retrieve the targeted data and examine its default value.
//
testNode = util.nodeObject(util.FIRST,util.SIXTH);
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
computedValue = streetAttr.Value;
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0006A --------------------------
//
//-------------------------- test case core-0007A ---------------------------
//
// Testing feature - The "name" Attribute of an Attribute node.
//
// Testing approach - Retrieve the attribute named "street" from the
// last child of the second employee and examine its "name"
// attribute. This test uses the "GetNamedItem(name)"
// method from the NamedNodeMap interface.
//
// Semantic Requirements: 5
//
//----------------------------------------------------------------------------
[Test]
public void core0007A()
{
string computedValue = "";
string expectedValue = "street";
System.Xml.XmlAttribute streetAttr = null;
System.Xml.XmlNode testNode = null;
testResults results = new testResults("Core0007A");
try
{
results.description = "The \"name\" attribute of an Attr object contains " +
"the name of that attribute.";
//
// Retrieve the targeted data and capture its assigned name.
//
testNode = util.nodeObject(util.SECOND,util.SIXTH);
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
computedValue = streetAttr.Name;
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0007A --------------------------
//
//-------------------------- test case core-0008A ---------------------------
//
// Testing feature - The "specified" attribute of an Attr node should be set
// to true if the attribute was explicitly given a value.
//
// Testing approach - Retrieve the attribute named "doestic" from the last
// child of the first employee and examine its "specified"
// attribute. It should be set to true. This test
// uses the "GetNamedItem(name)" method from the
// NamedNodeMap interface.
//
// Semantic Requirements: 6
//
//----------------------------------------------------------------------------
[Test]
public void core0008A()
{
string computedValue = "";//0;
string expectedValue = "True";
System.Xml.XmlNode testNode = null;
System.Xml.XmlAttribute domesticAttr = null;
testResults results = new testResults("Core0008A");
try
{
results.description = "The \"specified\" attribute for an Attr object " +
"should be set to true if the attribute was " +
"explictly given a value.";
//
// Retrieve the targeted data and capture its "specified" value.
//
testNode = util.nodeObject(util.FIRST,util.SIXTH);
domesticAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("domestic");;
computedValue = domesticAttr.Specified.ToString();
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0008A --------------------------
//
//-------------------------- test case core-0009A ---------------------------
//
// Testing feature - The "specified" attribute for an Attr node should be
// set to false if the attribute was not explicitly given
// a value.
//
// Testing approach - Retrieve the attribute named "street"(not explicity
// given a value) from the last child of the first employee
// and examine its "specified" attribute. It should be
// set to false. This test uses the
// "GetNamedItem(name)" method from the NamedNodeMap
// interface.
//
// Semantic Requirements: 6
//
//----------------------------------------------------------------------------
[Test]
public void core0009A()
{
string computedValue = "";//0;
string expectedValue = "False";
System.Xml.XmlAttribute streetAttr = null;
System.Xml.XmlNode testNode = null;
testResults results = new testResults("Core0009A");
try
{
results.description = "The \"specified\" attribute for an Attr node " +
"should be set to false if the attribute was " +
"not explictly given a value.";
//
// Retrieve the targeted data and capture its "specified" attribute.
//
testNode = util.nodeObject(util.FIRST,util.SIXTH);
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
computedValue = streetAttr.Specified.ToString();
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0009A --------------------------
//
//-------------------------- test case core-0010A ---------------------------
//
// Testing feature - The "specified" attribute for an Attr node should be
// automatically flipped to true if value of the attribute
// is changed (even its ends up having a default DTD value)
//
// Testing approach - Retrieve the attribute named "street" from the last
// child of the third employee and change its value to "Yes"
// (which is its default DTD value). This should cause the
// "specified" attribute to be flipped to true. This test
// makes use of the "setAttribute(name,value )" method from
// the Element interface and the "GetNamedItem(name)"
// method from the NamedNodeMap interface.
//
// Semantic Requirements: 7
//
//----------------------------------------------------------------------------
[Test]
public void core0010A()
{
string computedValue = "";//"";
string expectedValue = "True";
System.Xml.XmlAttribute streetAttr = null;
System.Xml.XmlElement testNode = null;
testResults results = new testResults("Core0010A");
try
{
results.description = "The \"specified\" attribute for an Attr node " +
"should be flipped to true if the attribute value " +
"is changed (even it changed to its default value).";
//
// Retrieve the targeted data and set a new attribute for it, then
// capture its "specified" attribute.
//
testNode = (System.Xml.XmlElement)util.nodeObject(util.THIRD,util.FIFTH);
testNode.SetAttribute("street","Yes");//testNode.node.setAttribute("street","Yes");
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
computedValue = streetAttr.Specified.ToString();
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0010A --------------------------
//
//-------------------------- test case core-0011A ---------------------------
//
// Testing feature - To respecify the attribute to its default value from the
// DTD, the attribute must be deleted. The implementation
// will then make a new attribute available with the
// "specified" attribute set to false.
// Testing approach - Retrieve the attribute named "street" from the last
// child of the third employee and delete it. The
// implementation should then create a new attribute with
// its default value and "specified" set to false. This
// test uses the "removeAttribute(name)" from the Element
// interface and the "GetNamedItem(name)" method from the
// NamedNodeMap interface.
//
// Semantic Requirements: 8
//
//----------------------------------------------------------------------------
[Test]
public void core0011A()
{
string computedValue = "";//"";
string expectedValue = "False";
System.Xml.XmlAttribute streetAttr = null;
System.Xml.XmlElement testNode = null;
testResults results = new testResults("Core0011A");
try
{
results.description = "Re-setting an attribute to its default value " +
"requires that the attribute be deleted. The " +
"implementation should create a new attribute " +
"with its \"specified\" attribute set to false.";
//
// Retrieve the targeted data, remove the "street" attribute and capture
// its specified attribute.
//
testNode = (System.Xml.XmlElement)util.nodeObject(util.THIRD,util.SIXTH);
testNode.RemoveAttribute("street");//testNode.node.removeAttribute("street");
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
computedValue = streetAttr.Specified.ToString();
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0011A --------------------------
//
//-------------------------- test case core-0012A ---------------------------
//
// Testing feature - Upon retrieval, the "value" of an attribute is returned
// as a string with characters and general entity references
// replaced with their values.
// Testing approach - Retrieve the attribute named "street" from the last
// child of the fourth employee and examine its value
// attribute. This value should be "Yes" after the
// EntityReference is replaced with its value. This
// test uses the "GetNamedItem(name)" method from
// the NamedNodeMap interface.
//
// Semantic Requirements: 9
//
//----------------------------------------------------------------------------
[Test]
public void core0012A()
{
string computedValue = "";
string expectedValue = "Yes";
System.Xml.XmlAttribute streetAttr = null;
System.Xml.XmlNode testNode = null;
testResults results = new testResults("Core0012A");
try
{
results.description = "Upon retrieval the \"value\" attribute of an Attr" +
"object is returned as a string with any Entity " +
"References replaced with their values.";
//
// Retrieve the targeted data.
//
testNode = util.nodeObject(util.FOURTH,util.SIXTH);
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
computedValue = streetAttr.Value;
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0012A --------------------------
//
//-------------------------- test case core-0013A ---------------------------
//
// Testing feature - On setting, the "value" attribute of an Attr node
// creates a Text node with the unparsed content of
// the string.
// Testing approach - Retrieve the attribute named "street" from the last
// child of the fourth employee and assign the "Y%ent1;"
// string to its value attribute. This value is not yet
// parsed and therefore should still be the same upon
// retrieval. This test uses the "GetNamedItem(name)"
// method from the NamedNodeMap interface.
//
// Semantic Requirements: 10
//
//----------------------------------------------------------------------------
[Test]
public void core0013A()
{
string computedValue = "";
string expectedValue = "Y%ent1;";
System.Xml.XmlAttribute streetAttr = null;
System.Xml.XmlNode testNode = null;
testResults results = new testResults("Core0013A");
try
{
results.description = "On setting, the \"value\" attribute of an Attr " +
"object creates a Text node with the unparsed " +
"content of the string.";
//
// Retrieve the targeted data, assign a value to it and capture its
// "value" attribute.
//
testNode = util.nodeObject(util.FOURTH,util.SIXTH);
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
streetAttr.Value = "Y%ent1;";
computedValue = streetAttr.Value;
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0013A --------------------------
//
//-------------------------- test case core-0014A ---------------------------
//
// Testing feature - Setting the "value" attribute raises a
// NO_MODIFICATION_ALLOWED_ERR Exception if the
// node is readonly.
//
// Testing approach - Retrieve the first attribute of the Entity node named
// "ent4" and attempt to change its value attribute.
// Since the descendants of Entity nodes are readonly, the
// desired exception should be raised.
//
// Semantic Requirements: 11
//
//----------------------------------------------------------------------------
[Test]
[Category ("NotDotNet")] // MS DOM is buggy
public void core0014A()
{
string computedValue = "";
System.Xml.XmlNode testNode = null;
System.Xml.XmlAttribute readOnlyAttribute = null;
string expectedValue = "System.ArgumentException";//util.NO_MODIFICATION_ALLOWED_ERR;
testResults results = new testResults("Core0014A");
try
{
results.description = "Setting the \"value\" attribute raises a " +
"NO_MODIFICATION_ALLOWED_ERR Exception if " +
"the node is readonly.";
//
// Retrieve the targeted data.
//
testNode = util.getEntity("ent4");
readOnlyAttribute = (System.Xml.XmlAttribute)testNode.FirstChild.Attributes.Item(0);
//
// attempt to set a value on a readonly node should raise an exception.
//
try
{
readOnlyAttribute.Value = "ABCD";
}
catch (ArgumentException ex)
{
computedValue = ex.GetType ().FullName;
}
}
catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
results.expected = expectedValue;
results.actual = computedValue;
util.resetData();
Assert.AreEqual (results.expected, results.actual);
// return results;
}
//------------------------ End test case core-0014A --------------------------
}
}
|