2007-02-04 yonik <yonik@mainsoft.com>
[mono.git] / mcs / class / System.Web / Test / System.Web.UI.WebControls / WebControlTest.cs
1 //
2 // Tests for System.Web.UI.WebControls.WebControl.cs 
3 //
4 // Author:
5 //      Peter Dennis Bartok (pbartok@novell.com)
6 //
7
8 //
9 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using NUnit.Framework;
32 using System;
33 using System.Collections;
34 using System.Drawing;
35 using System.IO;
36 using System.Globalization;
37 using System.Web;
38 using System.Web.UI;
39 using System.Web.UI.WebControls;
40 using MonoTests.stand_alone.WebHarness;
41
42 namespace MonoTests.System.Web.UI.WebControls
43 {
44         [TestFixture]   
45         public class WebControlTest {
46                 private static HtmlTextWriter GetWriter () {
47                         StringWriter sw = new StringWriter ();
48                         sw.NewLine = "\n";
49                         return new HtmlTextWriter (sw);
50                 }
51                 
52                 private bool IsEqual(object[] a1, object[] a2, string assertion) {
53                         int     matches;
54                         bool[]  notfound;       
55
56                         if (a1.Length != a2.Length) {
57                                 if (assertion != null) {
58                                         Assert.Fail(assertion + "( different length )");
59                                 }
60                                 return false;
61                         }
62
63                         matches = 0;
64                         notfound = new bool[a1.Length];
65
66                         for (int i = 0; i < a1.Length; i++) {
67                                 for (int j = 0; j < a2.Length; j++) {
68                                         if (a1[i].Equals(a2[j])) {
69                                                 matches++;
70                                                 break;
71                                         }
72                                 }
73                                 if ((assertion != null) && (matches != i+1)) {
74                                         Assert.Fail(assertion + "( missing " + a1[i].ToString() + " )");
75                                 }
76                         }
77
78                         return matches == a1.Length;
79                 }
80
81                 public class CustomControl : WebControl
82                 {
83                         public virtual string CustomProperty {
84                                 get {
85                                         return (string) ViewState ["CustomProperty"];
86                                 }
87                                 set {
88                                         ViewState ["CustomProperty"] = value;
89                                 }
90                         }
91
92                         protected override Style CreateControlStyle () {
93                                 return new Style ();
94                         }
95
96                         public void DoTrackViewState () {
97                                 TrackViewState ();
98                         }
99
100                         public object DoSaveViewState () {
101                                 return SaveViewState ();
102                         }
103
104                         public void DoLoadViewState (object state) {
105                                 LoadViewState (state);
106                         }
107                 }
108                 
109                 public class CustomControl2 : CustomControl
110                 {
111                         protected override Style CreateControlStyle () {
112                                 Style style = new Style (ViewState);
113                                 style.BackColor = Color.Blue;
114                                 return style;
115                         }
116                 }
117
118                 public class NamingContainer : WebControl, INamingContainer {
119
120                 }
121
122                 public class WebControlTestClass : WebControl {
123                         public WebControlTestClass() : base() {
124                         }
125
126                         public WebControlTestClass(string tag) : base(tag) {
127                         }
128
129                         public WebControlTestClass(HtmlTextWriterTag tag) : base(tag) {
130                         }
131
132                         public new HtmlTextWriterTag TagKey {
133                                 get {
134                                         return base.TagKey;
135                                 }
136                         }
137
138                         public new string TagName {
139                                 get {
140                                         return base.TagName;
141                                 }
142                         }
143
144                         public StateBag Bag {
145                                 get {
146                                         return base.ViewState;
147                                 }
148                         }
149
150                         public override bool EnableViewState {
151                                 get {
152                                         return base.EnableViewState;
153                                 }
154                         }
155
156                         public string Render () {
157                                 HtmlTextWriter  writer;
158
159                                 writer = WebControlTest.GetWriter();
160                                 base.Render (writer);
161                                 return writer.InnerWriter.ToString ();
162                         }
163
164                         public bool IsTrackingVS ()
165                         {
166                                 return IsTrackingViewState;
167                         }
168
169                         public void SetTrackingVS ()
170                         {
171                                 TrackViewState ();
172                         }
173
174                         public object Save() {
175                                 return base.SaveViewState();
176                         }
177
178                         public void Load(object o) {
179                                 base.LoadViewState(o);
180                         }
181
182                         public string[] KeyValuePairs() {
183                                 IEnumerator     e;
184                                 string[]        result;
185                                 int             item;
186
187                                 e = ViewState.GetEnumerator();
188                                 result = new string[ViewState.Keys.Count];
189                                 item = 0;
190
191                                 while (e.MoveNext()) {
192                                         DictionaryEntry d;
193                                         StateItem       si;
194
195                                         d = (DictionaryEntry)e.Current;
196                                         si = (StateItem)d.Value;
197
198                                         if (si.Value is String[]) {
199                                                 string[] values;
200
201                                                 values = (string[]) si.Value;
202                                                 result[item] = d.Key.ToString() + "=";
203                                                 if (values.Length > 0) {
204                                                         result[item] += values[0];
205
206                                                         for (int i = 1; i < values.Length; i++) {
207                                                                 result[item] += ", " + values[i];
208                                                         }
209                                                 }
210                                         } else {
211                                                 result[item] =  d.Key.ToString() + "=" + si.Value;
212                                         }
213                                         item++;
214                                 }
215
216                                 return result;
217                         }
218
219                         public Style DoCreateControlStyle () {
220                                 return base.CreateControlStyle ();
221                         }
222                 }
223
224                 [Test]
225                 public void CreateControlStyle () {
226                         WebControlTestClass w = new WebControlTestClass ();
227                         Assert.AreEqual (false, w.ControlStyleCreated, "CreateControlStyle#1");
228                         Style s = w.DoCreateControlStyle ();
229                         Assert.AreEqual (false, w.ControlStyleCreated, "CreateControlStyle#2");
230                         s = w.ControlStyle;
231                         Assert.AreEqual (true, w.ControlStyleCreated, "CreateControlStyle#3");
232                 }
233
234                 [Test]
235                 public void Constructors ()
236                 {
237                         WebControlTestClass     w;
238
239                         w = new WebControlTestClass();
240                         Assert.AreEqual(Color.Empty, w.BackColor, "C1");
241                         Assert.AreEqual(HtmlTextWriterTag.Span, w.TagKey, "C2");
242                         Assert.AreEqual("span", w.TagName, "C3");
243
244                         w = new WebControlTestClass("Small");
245                         Assert.AreEqual(HtmlTextWriterTag.Unknown, w.TagKey, "C4");
246                         Assert.AreEqual("Small", w.TagName, "C5");
247
248                         w = new WebControlTestClass(HtmlTextWriterTag.Small);
249                         Assert.AreEqual(HtmlTextWriterTag.Small, w.TagKey, "C5");
250                         Assert.AreEqual("small", w.TagName, "C6");
251                 }
252
253                 [Test]
254                 public void StyleCreation () {
255                         WebControlTestClass     w;
256
257                         w = new WebControlTestClass(HtmlTextWriterTag.Small);
258                         Assert.AreEqual(HtmlTextWriterTag.Small, w.TagKey, "C5");
259                         Assert.AreEqual("small", w.TagName, "C6");
260
261                         Assert.AreEqual(false, w.ControlStyleCreated, "C7");    // No style
262                         Assert.AreEqual(Color.Empty, w.BackColor, "C8");        // Force style creation?
263                         Assert.AreEqual(false, w.ControlStyleCreated, "C9");    // Nope, 'get' access didn't create it
264
265                         w.BackColor = Color.Red;                                // Forces style creation!
266                         Assert.AreEqual(Color.Red, w.BackColor, "C10");
267                         Assert.AreEqual(true, w.ControlStyleCreated, "C11");    // Now we have a style
268
269                         w = new WebControlTestClass(HtmlTextWriterTag.Script);
270                         Assert.AreEqual(HtmlTextWriterTag.Script, w.TagKey, "C12");
271                         Assert.AreEqual("script", w.TagName, "C13");
272                         Assert.AreEqual(false, w.ControlStyleCreated, "C14");   // Double-check
273                         Assert.IsNotNull(w.ControlStyle, "C15");                // Grab style, forcing creation
274                         Assert.AreEqual(true, w.ControlStyleCreated, "C16");    // Double-check
275                 }
276
277                 [Test]
278                 public void Defaults () {
279                         WebControlTestClass     w;
280
281                         w = new WebControlTestClass(HtmlTextWriterTag.Small);
282
283                         Assert.AreEqual ("", w.AccessKey, "D1");
284                         Assert.AreEqual (0, w.Attributes.Count, "D2");
285                         Assert.AreEqual (Color.Empty, w.BackColor, "D3");
286                         Assert.AreEqual (Color.Empty, w.BorderColor, "D4");
287                         Assert.AreEqual (BorderStyle.NotSet, w.BorderStyle, "D5");
288                         Assert.AreEqual (Unit.Empty, w.BorderWidth, "D6");
289                         Assert.AreEqual (string.Empty, w.CssClass, "D7");
290                         Assert.AreEqual (true, w.Enabled, "D8");
291                         Assert.AreEqual (Color.Empty, w.ForeColor, "D9");
292                         Assert.AreEqual (Unit.Empty, w.Height, "D10");
293                         Assert.AreEqual (0, w.Style.Count, "D11");
294                         Assert.AreEqual (0, w.TabIndex, "D12");
295                         Assert.AreEqual ("", w.ToolTip, "D13");
296                         Assert.AreEqual (Unit.Empty, w.Width, "D14");
297                 }
298
299                 [Test]
300                 public void Assignment () {
301                         WebControlTestClass     w;
302
303                         w = new WebControlTestClass(HtmlTextWriterTag.Small);
304
305                         w.BackColor = Color.Red;
306                         Assert.AreEqual (Color.Red, w.BackColor, "A1");
307
308                         w.Attributes["test"] = "testme";
309                         Assert.AreEqual (1, w.Attributes.Count, "A2");
310                         Assert.AreEqual ("testme", w.Attributes["test"], "A3");
311
312                         w.BorderColor = Color.Green;
313                         Assert.AreEqual (Color.Green, w.BorderColor, "A4");
314
315                         w.BorderStyle = BorderStyle.Dotted;
316                         Assert.AreEqual (BorderStyle.Dotted, w.BorderStyle, "A5");
317
318                         w.BorderWidth = new Unit("12px");
319                         Assert.AreEqual (12, w.BorderWidth.Value, "A6");
320
321                         Assert.AreEqual (string.Empty, w.CssClass, "A7");
322
323                         w.Enabled = false;
324                         Assert.AreEqual (false, w.Enabled, "A8");
325
326                         w.ForeColor = Color.BlueViolet;
327                         Assert.AreEqual (Color.BlueViolet, w.ForeColor, "A9");
328
329                         w.Height = new Unit(6.5);
330                         Assert.AreEqual (6, w.Height.Value, "A10");
331
332                         Assert.AreEqual (0, w.Style.Count, "A11");
333
334                         w.TabIndex = 10;
335                         Assert.AreEqual (10, w.TabIndex, "A12");
336
337                         w.ToolTip = "I am a tip";
338                         Assert.AreEqual ("I am a tip", w.ToolTip, "A13");
339
340                         w.Width = new Unit(6.5, UnitType.Cm);
341                         Assert.AreEqual (6.5, w.Width.Value, "A14");
342
343                         Assert.AreEqual(false, w.IsTrackingVS (), "A15");
344                         w.SetTrackingVS ();
345                         Assert.AreEqual(true, w.IsTrackingVS (), "A16");
346
347                         w.Enabled = true;
348                         Assert.AreEqual(true, w.Enabled, "A17");
349                         w.Save();
350
351                         w.Attributes["PrivateTag"] = "blah";
352                         Assert.AreEqual(2, w.Attributes.Count, "A18");
353
354                         w.Attributes.Clear();
355                         w.Attributes["Style"] = "background-color: #ff00ff";
356                         Assert.AreEqual(1, w.Attributes.Count, "A19");
357                         Assert.AreEqual(1, w.Style.Count, "A20");
358
359                         w.Attributes.Clear();
360                         w.Attributes.Add("Style", "foreground-color=#ff00ff");
361                         Assert.AreEqual(1, w.Attributes.Count, "A21");
362                         Assert.AreEqual(0, w.Style.Count, "A22");
363
364                         w.Attributes.Clear();
365                         w.Attributes.Add("Style", "background: black; text-align: left;");
366                         Assert.AreEqual(1, w.Attributes.Count, "A23");
367                         Assert.AreEqual(2, w.Style.Count, "A24");
368
369                         w.Attributes["Style"] = "background: black; text-align: left; foreground: white;";
370                         Assert.AreEqual(1, w.Attributes.Count, "A25");
371                         Assert.AreEqual(3, w.Style.Count, "A26");
372
373                         w.Style["background-color"] = Color.Purple.ToString();
374                         Assert.AreEqual(4, w.Style.Count, "A27");
375
376                         w.AccessKey = "I";
377                         Assert.AreEqual("I", w.AccessKey, "A28");
378
379                         // Check the bag
380                         string[]        expect = {
381                                                           "BorderStyle=Dotted",
382                                                           "Width=6.5cm",
383                                                           "Height=6px",
384                                                           "BorderWidth=12px",
385                                                           "ForeColor=Color [BlueViolet]",
386                                                           "BorderColor=Color [Green]",
387                                                           "ToolTip=I am a tip",
388                                                           "BackColor=Color [Red]",
389                                                           "TabIndex=10",
390                                                           "AccessKey=I",
391                                                           "Enabled=True" };
392
393                         IsEqual(expect, w.KeyValuePairs(), "A29");
394                 }
395
396                 [Test]
397                 public void Methods() {
398                         WebControlTestClass     w;
399                         WebControlTestClass     w_copy;
400
401                         w = new WebControlTestClass(HtmlTextWriterTag.Xml);
402                         w_copy = new WebControlTestClass(HtmlTextWriterTag.Xml);
403
404                         w.Enabled = true;
405                         w.AccessKey = "I";
406                         w.Attributes["Argl"] = "Arglbla";
407                         w.Attributes.Add("Style", "background: black; text-align: left;");
408                         Assert.AreEqual(2, w.Attributes.Count, "M1");
409                         Assert.AreEqual(2, w.Style.Count, "M2");
410                         w_copy.TabIndex = 10;
411                         w_copy.Attributes["Blah"] = "blahblah";
412
413                         Assert.AreEqual(0, w.TabIndex, "M3");
414                         Assert.AreEqual(10, w_copy.TabIndex, "M4");
415                         w_copy.CopyBaseAttributes(w);
416
417                         Assert.AreEqual(10, w_copy.TabIndex, "M5");
418                         Assert.AreEqual("blahblah", w_copy.Attributes["Blah"], "M6");
419                         Assert.AreEqual("Arglbla", w_copy.Attributes["Argl"], "M7");
420
421                         // Styles should make it over, too
422                         Assert.AreEqual("black", w_copy.Style["background"], "M8");
423
424                         // Check the bag
425                         string[]        expect = {
426                                                          "TabIndex=10",
427                                                          "AccessKey=I" };
428
429                         IsEqual(expect, w_copy.KeyValuePairs(), "M9");
430
431                         Assert.AreEqual("<xml accesskey=\"I\" Argl=\"Arglbla\" style=\"background: black; text-align: left;\">\n\n</xml>", w.Render(), "M10");
432                         Assert.AreEqual("<xml accesskey=\"I\" tabindex=\"10\" Blah=\"blahblah\" Argl=\"Arglbla\" style=\"background: black; text-align: left;\">\n\n</xml>", w_copy.Render(), "M11");
433                 }
434
435                 [Test]
436                 public void CopyEnabled ()
437                 {
438                         Label l = new Label (), ll = new Label ();
439                         l.Enabled = false;
440                         ll.CopyBaseAttributes (l);
441                         Assert.IsFalse (ll.Enabled, "enabled should be copied");
442                 }
443                 
444
445                 [Test]
446                 public void RenderClientId ()
447                 {
448                         NamingContainer container = new NamingContainer ();
449                         WebControlTestClass child = new WebControlTestClass ();
450
451                         container.Controls.Add (child);
452                         container.ID = "naming";
453                         child.ID = "fooid";
454
455                         Assert.AreEqual ("<span id=\"naming_fooid\"></span>", child.Render (), "A1");
456                 }
457
458                 
459                 [Test]
460                 public void ViewState() {
461                         WebControlTestClass     w;
462                         WebControlTestClass     w_copy;
463                         object                  state;
464
465                         w = new WebControlTestClass(HtmlTextWriterTag.Xml);
466                         w_copy = new WebControlTestClass(HtmlTextWriterTag.Xml);
467
468                         w.SetTrackingVS ();
469                         w.BackColor = Color.Red;
470                         w.Attributes["test"] = "testme";
471                         w.BorderColor = Color.Green;
472                         w.BorderStyle = BorderStyle.Dotted;
473                         w.BorderWidth = new Unit("12px");
474                         w.Enabled = false;
475                         w.ForeColor = Color.BlueViolet;
476                         w.Height = new Unit(6.5);
477                         w.TabIndex = 10;
478                         w.ToolTip = "I am a tip";
479                         w.Width = new Unit(6.5, UnitType.Cm);
480                         w.Enabled = true;
481                         w.Attributes["PrivateTag"] = "blah";
482                         w.Attributes["Style"] = "background-color: #ff00ff";
483
484                         state = w.Save();
485
486                         w_copy.Load(state);
487                         w_copy.SetTrackingVS();
488                         /* MS: <xml tabindex="10" title="I am a tip" test="testme" PrivateTag="blah" 
489                                 style="color:BlueViolet;background-color:Red;border-color:Green;border-width:12px;border-style:Dotted;height:6px;width:6.5cm;background-color: #ff00ff">
490                                 </xml>
491                         */
492                         HtmlDiff.AssertAreEqual (w.Render(), w_copy.Render(), "VS1");
493                 }
494
495                 [Test]
496                 public void ViewState2 () {
497                         CustomControl c = new CustomControl ();
498                         CustomControl copy = new CustomControl ();
499                         object state;
500
501                         c.DoTrackViewState ();
502                         c.CustomProperty = "CustomProperty";
503                         c.ControlStyle.BackColor = Color.Red;
504                         c.ControlStyle.BorderColor = Color.Green;
505                         c.ControlStyle.BorderStyle = BorderStyle.Dotted;
506
507                         state = c.DoSaveViewState ();
508
509                         copy.DoLoadViewState (state);
510
511                         Assert.IsFalse (copy.ControlStyleCreated, "copy.ControlStyleCreated");
512                 }
513                 
514                 [Test]
515                 public void ViewState3 () {
516                         CustomControl2 c = new CustomControl2 ();
517                         CustomControl2 copy = new CustomControl2 ();
518                         object state;
519
520                         c.DoTrackViewState ();
521                         c.ControlStyle.BackColor = Color.Red;
522
523                         state = c.DoSaveViewState ();
524
525                         copy.DoLoadViewState (state);
526
527                         Assert.AreEqual (Color.Blue, copy.ControlStyle.BackColor, "copy.BackColor");
528
529                 }
530
531                 [Test]
532                 public void RenderBeginTag_TagOnly ()
533                 {
534                         HtmlTextWriter writer = WebControlTest.GetWriter ();
535                         WebControl wc = new WebControl (HtmlTextWriterTag.Table);
536                         wc.RenderBeginTag (writer);
537                         string s = writer.InnerWriter.ToString ();
538                         Assert.AreEqual ("<table>\n", s, "table");
539                 }
540
541                 [Test]
542                 public void RenderBeginTag_Attributes ()
543                 {
544                         HtmlTextWriter writer = WebControlTest.GetWriter ();
545                         WebControl wc = new WebControl (HtmlTextWriterTag.Table);
546                         wc.ID = "test1";
547                         wc.RenderBeginTag (writer);
548                         string s = writer.InnerWriter.ToString ();
549                         Assert.AreEqual ("<table id=\"test1\">\n", s, "ID");
550
551                         writer = WebControlTest.GetWriter ();
552                         wc.ID = null;
553                         Assert.IsNull (wc.ID, "ID");
554                         wc.RenderBeginTag (writer);
555                         s = writer.InnerWriter.ToString ();
556                         Assert.AreEqual ("<table>\n", s, "-ID");
557                 }
558
559                 [Test]
560                 public void RenderBeginTag_Style ()
561                 {
562                         HtmlTextWriter writer = WebControlTest.GetWriter ();
563                         WebControl wc = new WebControl (HtmlTextWriterTag.Table);
564                         wc.BackColor = Color.Aqua;
565                         wc.RenderBeginTag (writer);
566                         string s = writer.InnerWriter.ToString ();
567                         Assert.AreEqual ("<table style=\"background-color:Aqua;\">\n", s, "BackColor");
568
569                         writer = WebControlTest.GetWriter ();
570                         wc.BackColor = new Color ();
571                         Assert.IsTrue (wc.BackColor.IsEmpty, "IsEmpty");
572                         wc.RenderBeginTag (writer);
573                         s = writer.InnerWriter.ToString ();
574                         Assert.AreEqual ("<table>\n", s, "-BackColor");
575                 }
576
577                 [Test]
578                 public void RenderBeginTag_BorderWidth_span ()
579                 {
580                         HtmlTextWriter writer = WebControlTest.GetWriter ();
581                         WebControl wc = new WebControl (HtmlTextWriterTag.Span);
582                         wc.BorderWidth = Unit.Pixel (1);
583                         wc.RenderBeginTag (writer);
584                         string s = writer.InnerWriter.ToString ();
585 #if NET_2_0
586                         Assert.AreEqual ("<span style=\"display:inline-block;border-width:1px;border-style:solid;\">", s, "BorderWidth");
587 #else
588                         Assert.AreEqual ("<span style=\"border-width:1px;border-style:solid;\">", s, "BorderWidth");
589 #endif
590                 }
591
592                 [Test]
593                 public void RenderBeginTag_BorderWidth_table ()
594                 {
595                         HtmlTextWriter writer = WebControlTest.GetWriter ();
596                         WebControl wc = new WebControl (HtmlTextWriterTag.Table);
597                         wc.BorderWidth = Unit.Pixel (1);
598                         wc.RenderBeginTag (writer);
599                         string s = writer.InnerWriter.ToString ();
600                         Assert.AreEqual ("<table style=\"border-width:1px;border-style:solid;\">\n", s, "BorderWidth");
601                 }
602
603                 [Test]
604                 public void EmptyStringTag ()
605                 {
606                         WebControlTestClass wc = new WebControlTestClass (String.Empty);
607                         Assert.AreEqual ("<>\n\n</>", wc.Render ());
608                 }
609
610                 [Test]
611                 public void NullStringTag ()
612                 {
613                         WebControlTestClass wc = new WebControlTestClass (null);
614                         Assert.AreEqual ("<>\n\n</>", wc.Render ());
615                 }
616
617                 [Test]
618                 public void UnknownTag ()
619                 {
620                         WebControlTestClass wc = new WebControlTestClass (HtmlTextWriterTag.Unknown);
621                         Assert.AreEqual ("<>\n\n</>", wc.Render ());
622                 }
623
624                 [Test]
625                 public void EnabledViewState ()
626                 {
627                         WebControlTestClass c = new WebControlTestClass ();
628                         c.SetTrackingVS ();
629                         c.Enabled = false;
630                         object o = c.Save ();
631                         c = new WebControlTestClass ();
632                         c.Load (o);
633                         Assert.IsFalse (c.Enabled, "not enabled");
634                 }
635
636                 [Test]
637                 public void AttributeIsCaseInsensitive ()
638                 {
639                         WebControlTestClass c = new WebControlTestClass ();
640                         c.Attributes ["hola"] = "hello";
641                         c.Attributes ["HOla"] = "hi";
642                         Assert.AreEqual ("hi", c.Attributes ["hoLA"], "#01");
643                 }
644         }
645 }