2008-12-08 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / Managed.Windows.Forms / Test / System.Windows.Forms / ControlStyleTest.cs
1 //
2 // ControlStyleTest.cs (Auto-generated by GenerateControlStyleTest.cs).
3 //
4 // Author: 
5 //   Peter Dennis Bartok (pbartok@novell.com)
6 //
7 // (C) 2005 Novell, Inc. (http://www.novell.com)
8 //
9 using System;
10 using System.Windows.Forms;
11 using System.Drawing;
12 using System.Reflection;
13 using NUnit.Framework;
14
15 namespace MonoTests.System.Windows.Forms {
16         [TestFixture]
17         public class TestControlStyle  : TestHelper {
18
19                 static Array style_values = Enum.GetValues(typeof(ControlStyles));
20                 static string[] style_names = Enum.GetNames(typeof(ControlStyles));
21
22                 public void AssertAreEqual(string[] want, string[] got, string name) {
23                         if (want.Length == got.Length) {
24                                 for (int i=0; i < want.Length; i++) {
25                                         if (want[i] != got[i]) {
26                                                 Console.WriteLine("{0}: Expected {1}, got {2}", name, want[i], got[i]);
27                                         }
28                                 }
29                         }
30                         Assert.AreEqual(want, got, name);
31                 }
32
33                 public static void CheckStyles (Control ctrl, string msg, params ControlStyles [] ExpectedStyles)
34                 {
35                         MethodInfo method = ctrl.GetType ().GetMethod ("GetStyle", BindingFlags.ExactBinding | BindingFlags.NonPublic | BindingFlags.Instance, null, new Type [] {typeof(ControlStyles)}, null);
36                         Assert.IsNotNull (method, "Cannot complete test, didn't find GetStyle method on Control");
37                         
38                         string failed = "";
39                         
40                         if (ExpectedStyles == null)
41                                 ExpectedStyles = new ControlStyles [0];
42                         foreach (ControlStyles style in Enum.GetValues (typeof(ControlStyles))) {
43                                 bool result = (bool) method.Invoke (ctrl, new object [] {style});
44                                 if (Array.IndexOf (ExpectedStyles, style) >= 0) {
45                                         if (!result) 
46                                                 failed += "\t" + "ControlStyles." + style.ToString () + " was expected, but is not set." + Environment.NewLine;
47                                 } else {
48                                         if (result)
49                                                 failed += "\t" + "ControlStyles." + style.ToString () + " is set, but was not expected." + Environment.NewLine;
50                                 }
51                         }
52                         if (failed != String.Empty) {
53                                 Assert.Fail (msg + Environment.NewLine + failed);
54                         }
55                 }
56
57                 public static string[] GetStyles(Control control) {
58                         string[] result;
59
60                         result = new string[style_names.Length];
61
62                         for (int i = 0; i < style_values.Length; i++) {
63                                 result[i] = style_names[i] + "=" + control.GetType().GetMethod("GetStyle", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(control, new object[1] {(ControlStyles)style_values.GetValue(i)});
64                         }
65
66                         return result;
67                 }
68
69                 [Test]
70                 public void ControlStyleTest ()
71                 {
72                         string[] Control_want = {
73                                 "ContainerControl=False",
74                                 "UserPaint=True",
75                                 "Opaque=False",
76                                 "ResizeRedraw=False",
77                                 "FixedWidth=False",
78                                 "FixedHeight=False",
79                                 "StandardClick=True",
80                                 "Selectable=True",
81                                 "UserMouse=False",
82                                 "SupportsTransparentBackColor=False",
83                                 "StandardDoubleClick=True",
84                                 "AllPaintingInWmPaint=True",
85                                 "CacheText=False",
86                                 "EnableNotifyMessage=False",
87                                 "DoubleBuffer=False",
88 #if NET_2_0
89                                 "OptimizedDoubleBuffer=False",
90                                 "UseTextForAccessibility=True"
91 #endif
92                         };
93
94                         Assert.AreEqual(Control_want, GetStyles(new Control()), "ControlStyles");
95                 }
96
97
98                 [Test]
99                 public void ButtonStyleTest ()
100                 {
101                         string[] Button_want = {
102                                 "ContainerControl=False",
103                                 "UserPaint=True",
104                                 "Opaque=True",
105                                 "ResizeRedraw=True",
106                                 "FixedWidth=False",
107                                 "FixedHeight=False",
108                                 "StandardClick=False",
109                                 "Selectable=True",
110                                 "UserMouse=True",
111                                 "SupportsTransparentBackColor=True",
112                                 "StandardDoubleClick=False",
113                                 "AllPaintingInWmPaint=True",
114                                 "CacheText=True",
115                                 "EnableNotifyMessage=False",
116 #if NET_2_0
117                                 "DoubleBuffer=False",
118                                 "OptimizedDoubleBuffer=True",
119                                 "UseTextForAccessibility=True"
120 #else
121                                 "DoubleBuffer=True"
122 #endif
123                         };
124
125                         Assert.AreEqual(Button_want, GetStyles(new Button()), "ButtonStyles");
126                 }
127
128                 [Test]
129                 public void CheckBoxStyleTest ()
130                 {
131                         string[] CheckBox_want = {
132                                 "ContainerControl=False",
133                                 "UserPaint=True",
134                                 "Opaque=True",
135                                 "ResizeRedraw=True",
136                                 "FixedWidth=False",
137                                 "FixedHeight=False",
138                                 "StandardClick=False",
139                                 "Selectable=True",
140                                 "UserMouse=True",
141                                 "SupportsTransparentBackColor=True",
142                                 "StandardDoubleClick=False",
143                                 "AllPaintingInWmPaint=True",
144                                 "CacheText=True",
145                                 "EnableNotifyMessage=False",
146 #if NET_2_0
147                                 "DoubleBuffer=False",
148                                 "OptimizedDoubleBuffer=True",
149                                 "UseTextForAccessibility=True"
150 #else
151                                 "DoubleBuffer=True"
152 #endif
153                         };
154
155                         Assert.AreEqual(CheckBox_want, GetStyles(new CheckBox()), "CheckBoxStyles");
156                 }
157
158                 [Test]
159                 public void RadioButtonStyleTest ()
160                 {
161                         string[] RadioButton_want = {
162                                 "ContainerControl=False",
163                                 "UserPaint=True",
164                                 "Opaque=True",
165                                 "ResizeRedraw=True",
166                                 "FixedWidth=False",
167                                 "FixedHeight=False",
168                                 "StandardClick=False",
169                                 "Selectable=True",
170                                 "UserMouse=True",
171                                 "SupportsTransparentBackColor=True",
172                                 "StandardDoubleClick=True",
173                                 "AllPaintingInWmPaint=True",
174                                 "CacheText=True",
175                                 "EnableNotifyMessage=False",
176 #if NET_2_0
177                                 "DoubleBuffer=False",
178                                 "OptimizedDoubleBuffer=True",
179                                 "UseTextForAccessibility=True"
180 #else
181                                 "DoubleBuffer=True"
182 #endif
183                         };
184
185                         Assert.AreEqual(RadioButton_want, GetStyles(new RadioButton()), "RadioButtonStyles");
186                 }
187
188                 [Test]
189                 public void DataGridStyleTest ()
190                 {
191                         string[] DataGrid_want = {
192                                 "ContainerControl=False",
193                                 "UserPaint=True",
194                                 "Opaque=False",
195                                 "ResizeRedraw=False",
196                                 "FixedWidth=False",
197                                 "FixedHeight=False",
198                                 "StandardClick=True",
199                                 "Selectable=True",
200                                 "UserMouse=True",
201                                 "SupportsTransparentBackColor=False",
202                                 "StandardDoubleClick=True",
203                                 "AllPaintingInWmPaint=True",
204                                 "CacheText=False",
205                                 "EnableNotifyMessage=False",
206                                 "DoubleBuffer=False",
207 #if NET_2_0
208                                 "OptimizedDoubleBuffer=False",
209                                 "UseTextForAccessibility=True"
210 #endif
211                         };
212
213                         Assert.AreEqual(DataGrid_want, GetStyles(new DataGrid()), "DataGridStyles");
214                 }
215
216                 [Test]
217                 public void DateTimePickerStyleTest ()
218                 {
219                         string[] DateTimePicker_want = {
220                                 "ContainerControl=False",
221                                 "UserPaint=False",
222                                 "Opaque=False",
223                                 "ResizeRedraw=False",
224                                 "FixedWidth=False",
225                                 "FixedHeight=True",
226                                 "StandardClick=False",
227                                 "Selectable=True",
228                                 "UserMouse=False",
229                                 "SupportsTransparentBackColor=False",
230                                 "StandardDoubleClick=True",
231                                 "AllPaintingInWmPaint=True",
232                                 "CacheText=False",
233                                 "EnableNotifyMessage=False",
234                                 "DoubleBuffer=False",
235 #if NET_2_0
236                                 "OptimizedDoubleBuffer=False",
237                                 "UseTextForAccessibility=True"
238 #endif
239                         };
240
241                         Assert.AreEqual(DateTimePicker_want, GetStyles(new DateTimePicker()), "DateTimePickerStyles");
242                 }
243
244                 [Test]
245                 public void GroupBoxStyleTest ()
246                 {
247                         string[] GroupBox_want = {
248                                 "ContainerControl=True",
249                                 "UserPaint=True",
250                                 "Opaque=False",
251                                 "ResizeRedraw=True",
252                                 "FixedWidth=False",
253                                 "FixedHeight=False",
254                                 "StandardClick=True",
255                                 "Selectable=False",
256                                 "UserMouse=False",
257                                 "SupportsTransparentBackColor=True",
258                                 "StandardDoubleClick=True",
259                                 "AllPaintingInWmPaint=True",
260                                 "CacheText=False",
261                                 "EnableNotifyMessage=False",
262                                 "DoubleBuffer=False",
263 #if NET_2_0
264                                 "OptimizedDoubleBuffer=False",
265                                 "UseTextForAccessibility=True"
266 #endif
267                         };
268
269                         Assert.AreEqual(GroupBox_want, GetStyles(new GroupBox()), "GroupBoxStyles");
270                 }
271
272                 [Test]
273                 public void LabelStyleTest ()
274                 {
275                         string[] Label_want = {
276                                 "ContainerControl=False",
277                                 "UserPaint=True",
278                                 "Opaque=False",
279                                 "ResizeRedraw=True",
280                                 "FixedWidth=False",
281                                 "FixedHeight=False",
282                                 "StandardClick=True",
283                                 "Selectable=False",
284                                 "UserMouse=False",
285                                 "SupportsTransparentBackColor=True",
286                                 "StandardDoubleClick=True",
287                                 "AllPaintingInWmPaint=True",
288                                 "CacheText=False",
289                                 "EnableNotifyMessage=False",
290 #if NET_2_0
291                                 "DoubleBuffer=False",
292                                 "OptimizedDoubleBuffer=True",
293                                 "UseTextForAccessibility=True"
294 #else
295                                 "DoubleBuffer=True"
296 #endif
297                         };
298
299                         Assert.AreEqual(Label_want, GetStyles(new Label()), "LabelStyles");
300                 }
301
302                 [Test]
303                 public void LinkLabelStyleTest ()
304                 {
305                         string[] LinkLabel_want = {
306                                 "ContainerControl=False",
307                                 "UserPaint=True",
308                                 "Opaque=True",
309                                 "ResizeRedraw=True",
310                                 "FixedWidth=False",
311                                 "FixedHeight=False",
312                                 "StandardClick=True",
313                                 "Selectable=False",
314                                 "UserMouse=False",
315                                 "SupportsTransparentBackColor=True",
316                                 "StandardDoubleClick=True",
317                                 "AllPaintingInWmPaint=True",
318                                 "CacheText=False",
319                                 "EnableNotifyMessage=False",
320 #if NET_2_0
321                                 "DoubleBuffer=False",
322                                 "OptimizedDoubleBuffer=True",
323                                 "UseTextForAccessibility=True"
324 #else
325                                 "DoubleBuffer=True"
326 #endif
327                         };
328
329                         string[] LinkLabel_link_want = {
330                                 "ContainerControl=False",
331                                 "UserPaint=True",
332                                 "Opaque=True",
333                                 "ResizeRedraw=True",
334                                 "FixedWidth=False",
335                                 "FixedHeight=False",
336                                 "StandardClick=True",
337                                 "Selectable=True",
338                                 "UserMouse=False",
339                                 "SupportsTransparentBackColor=True",
340                                 "StandardDoubleClick=True",
341                                 "AllPaintingInWmPaint=True",
342                                 "CacheText=False",
343                                 "EnableNotifyMessage=False",
344 #if NET_2_0
345                                 "DoubleBuffer=False",
346                                 "OptimizedDoubleBuffer=True",
347                                 "UseTextForAccessibility=True"
348 #else
349                                 "DoubleBuffer=True"
350 #endif
351                         };
352
353                         LinkLabel link = new LinkLabel ();
354
355                         // Test LinkLabel without text and without links
356                         Assert.AreEqual(LinkLabel_want, GetStyles(link), "#1");
357
358                         // Test LinkLabel with only text
359                         link.Text = "Users need not fear making the switch to Linux";
360                         link.Links.Clear ();
361                         Assert.AreEqual (LinkLabel_want, GetStyles (link), "#2");
362
363                         // Test LinkLabel with a link
364                         link.Links.Add (6, 9, "http://link1");
365                         Assert.AreEqual(LinkLabel_link_want, GetStyles(link), "#3");
366                 }
367
368                 [Test]
369                 public void ComboBoxStyleTest ()
370                 {
371                         string[] ComboBox_want = {
372                                 "ContainerControl=False",
373                                 "UserPaint=False",
374                                 "Opaque=False",
375                                 "ResizeRedraw=False",
376                                 "FixedWidth=False",
377                                 "FixedHeight=False",
378                                 "StandardClick=False",
379                                 "Selectable=True",
380                                 "UserMouse=False",
381                                 "SupportsTransparentBackColor=False",
382                                 "StandardDoubleClick=True",
383                                 "AllPaintingInWmPaint=True",
384                                 "CacheText=False",
385                                 "EnableNotifyMessage=False",
386                                 "DoubleBuffer=False",
387 #if NET_2_0
388                                 "OptimizedDoubleBuffer=False",
389                                 "UseTextForAccessibility=False"
390 #endif
391                         };
392
393                         Assert.AreEqual(ComboBox_want, GetStyles(new ComboBox()), "ComboBoxStyles");
394                 }
395
396                 [Test]
397                 public void ListBoxStyleTest ()
398                 {
399                         string[] ListBox_want = {
400                                 "ContainerControl=False",
401                                 "UserPaint=False",
402                                 "Opaque=False",
403                                 "ResizeRedraw=False",
404                                 "FixedWidth=False",
405                                 "FixedHeight=False",
406                                 "StandardClick=False",
407                                 "Selectable=True",
408                                 "UserMouse=False",
409                                 "SupportsTransparentBackColor=False",
410                                 "StandardDoubleClick=True",
411                                 "AllPaintingInWmPaint=True",
412                                 "CacheText=False",
413                                 "EnableNotifyMessage=False",
414                                 "DoubleBuffer=False",
415 #if NET_2_0
416                                 "OptimizedDoubleBuffer=False",
417                                 "UseTextForAccessibility=False"
418 #endif
419                         };
420
421                         Assert.AreEqual(ListBox_want, GetStyles(new ListBox()), "ListBoxStyles");
422                 }
423
424                 [Test]
425                 public void CheckedListBoxStyleTest ()
426                 {
427                         string[] CheckedListBox_want = {
428                                 "ContainerControl=False",
429                                 "UserPaint=False",
430                                 "Opaque=False",
431                                 "ResizeRedraw=True",
432                                 "FixedWidth=False",
433                                 "FixedHeight=False",
434                                 "StandardClick=False",
435                                 "Selectable=True",
436                                 "UserMouse=False",
437                                 "SupportsTransparentBackColor=False",
438                                 "StandardDoubleClick=True",
439                                 "AllPaintingInWmPaint=True",
440                                 "CacheText=False",
441                                 "EnableNotifyMessage=False",
442                                 "DoubleBuffer=False",
443 #if NET_2_0
444                                 "OptimizedDoubleBuffer=False",
445                                 "UseTextForAccessibility=False"
446 #endif
447                         };
448
449                         Assert.AreEqual(CheckedListBox_want, GetStyles(new CheckedListBox()), "CheckedListBoxStyles");
450                 }
451
452                 [Test]
453                 public void ListViewStyleTest ()
454                 {
455                         string[] ListView_want = {
456                                 "ContainerControl=False",
457                                 "UserPaint=False",
458                                 "Opaque=False",
459                                 "ResizeRedraw=False",
460                                 "FixedWidth=False",
461                                 "FixedHeight=False",
462                                 "StandardClick=False",
463                                 "Selectable=True",
464                                 "UserMouse=False",
465                                 "SupportsTransparentBackColor=False",
466                                 "StandardDoubleClick=True",
467                                 "AllPaintingInWmPaint=True",
468                                 "CacheText=False",
469                                 "EnableNotifyMessage=False",
470                                 "DoubleBuffer=False",
471 #if NET_2_0
472                                 "OptimizedDoubleBuffer=False",
473                                 "UseTextForAccessibility=False"
474 #endif
475                         };
476
477                         Assert.AreEqual(ListView_want, GetStyles(new ListView()), "ListViewStyles");
478                 }
479
480                 [Test]
481                 public void MdiClientStyleTest ()
482                 {
483                         string[] MdiClient_want = {
484                                 "ContainerControl=False",
485                                 "UserPaint=True",
486                                 "Opaque=False",
487                                 "ResizeRedraw=False",
488                                 "FixedWidth=False",
489                                 "FixedHeight=False",
490                                 "StandardClick=True",
491                                 "Selectable=False",
492                                 "UserMouse=False",
493                                 "SupportsTransparentBackColor=False",
494                                 "StandardDoubleClick=True",
495                                 "AllPaintingInWmPaint=True",
496                                 "CacheText=False",
497                                 "EnableNotifyMessage=False",
498                                 "DoubleBuffer=False",
499 #if NET_2_0
500                                 "OptimizedDoubleBuffer=False",
501                                 "UseTextForAccessibility=True"
502 #endif
503                         };
504
505                         Assert.AreEqual(MdiClient_want, GetStyles(new MdiClient()), "MdiClientStyles");
506                 }
507
508                 [Test]
509                 public void MonthCalendarStyleTest ()
510                 {
511                         string[] MonthCalendar_want = {
512                                 "ContainerControl=False",
513                                 "UserPaint=False",
514                                 "Opaque=False",
515                                 "ResizeRedraw=False",
516                                 "FixedWidth=False",
517                                 "FixedHeight=False",
518                                 "StandardClick=False",
519                                 "Selectable=True",
520                                 "UserMouse=False",
521                                 "SupportsTransparentBackColor=False",
522                                 "StandardDoubleClick=True",
523                                 "AllPaintingInWmPaint=True",
524                                 "CacheText=False",
525                                 "EnableNotifyMessage=False",
526                                 "DoubleBuffer=False",
527 #if NET_2_0
528                                 "OptimizedDoubleBuffer=False",
529                                 "UseTextForAccessibility=True"
530 #endif
531                         };
532
533                         Assert.AreEqual(MonthCalendar_want, GetStyles(new MonthCalendar()), "MonthCalendarStyles");
534                 }
535
536                 [Test]
537                 public void PictureBoxStyleTest ()
538                 {
539                         string[] PictureBox_want = {
540                                 "ContainerControl=False",
541                                 "UserPaint=True",
542                                 "Opaque=False",
543                                 "ResizeRedraw=False",
544                                 "FixedWidth=False",
545                                 "FixedHeight=False",
546                                 "StandardClick=True",
547                                 "Selectable=False",
548                                 "UserMouse=False",
549                                 "SupportsTransparentBackColor=True",
550                                 "StandardDoubleClick=True",
551                                 "AllPaintingInWmPaint=True",
552                                 "CacheText=False",
553                                 "EnableNotifyMessage=False",
554 #if NET_2_0
555                                 "DoubleBuffer=False",
556                                 "OptimizedDoubleBuffer=True",
557                                 "UseTextForAccessibility=True"
558 #else
559                                 "DoubleBuffer=True"
560 #endif
561                         };
562
563                         Assert.AreEqual(PictureBox_want, GetStyles(new PictureBox()), "PictureBoxStyles");
564                 }
565
566                 [Test]
567                 public void ProgressBarStyleTest ()
568                 {
569                         string[] ProgressBar_want = {
570                                 "ContainerControl=False",
571                                 "UserPaint=False",
572                                 "Opaque=False",
573                                 "ResizeRedraw=False",
574                                 "FixedWidth=False",
575                                 "FixedHeight=False",
576                                 "StandardClick=True",
577                                 "Selectable=False",
578                                 "UserMouse=False",
579                                 "SupportsTransparentBackColor=False",
580                                 "StandardDoubleClick=True",
581                                 "AllPaintingInWmPaint=True",
582                                 "CacheText=False",
583                                 "EnableNotifyMessage=False",
584                                 "DoubleBuffer=False",
585 #if NET_2_0
586                                 "OptimizedDoubleBuffer=False",
587                                 "UseTextForAccessibility=False"
588 #endif
589                         };
590
591                         Assert.AreEqual(ProgressBar_want, GetStyles(new ProgressBar()), "ProgressBarStyles");
592                 }
593
594                 [Test]
595                 public void ScrollableControlStyleTest ()
596                 {
597                         string[] ScrollableControl_want = {
598                                 "ContainerControl=True",
599                                 "UserPaint=True",
600                                 "Opaque=False",
601                                 "ResizeRedraw=False",
602                                 "FixedWidth=False",
603                                 "FixedHeight=False",
604                                 "StandardClick=True",
605                                 "Selectable=True",
606                                 "UserMouse=False",
607                                 "SupportsTransparentBackColor=False",
608                                 "StandardDoubleClick=True",
609                                 "AllPaintingInWmPaint=False",
610                                 "CacheText=False",
611                                 "EnableNotifyMessage=False",
612                                 "DoubleBuffer=False",
613 #if NET_2_0
614                                 "OptimizedDoubleBuffer=False",
615                                 "UseTextForAccessibility=True"
616 #endif
617                         };
618
619                         Assert.AreEqual(ScrollableControl_want, GetStyles(new ScrollableControl()), "ScrollableControlStyles");
620                 }
621
622                 [Test]
623                 public void ContainerControlStyleTest ()
624                 {
625                         string[] ContainerControl_want = {
626                                 "ContainerControl=True",
627                                 "UserPaint=True",
628                                 "Opaque=False",
629                                 "ResizeRedraw=False",
630                                 "FixedWidth=False",
631                                 "FixedHeight=False",
632                                 "StandardClick=True",
633                                 "Selectable=True",
634                                 "UserMouse=False",
635                                 "SupportsTransparentBackColor=False",
636                                 "StandardDoubleClick=True",
637                                 "AllPaintingInWmPaint=False",
638                                 "CacheText=False",
639                                 "EnableNotifyMessage=False",
640                                 "DoubleBuffer=False",
641 #if NET_2_0
642                                 "OptimizedDoubleBuffer=False",
643                                 "UseTextForAccessibility=True"
644 #endif
645                         };
646
647                         Assert.AreEqual(ContainerControl_want, GetStyles(new ContainerControl()), "ContainerControlStyles");
648                 }
649
650                 [Test]
651                 public void FormStyleTest ()
652                 {
653                         string[] Form_want = {
654                                 "ContainerControl=True",
655                                 "UserPaint=True",
656                                 "Opaque=False",
657                                 "ResizeRedraw=False",
658                                 "FixedWidth=False",
659                                 "FixedHeight=False",
660                                 "StandardClick=True",
661                                 "Selectable=True",
662                                 "UserMouse=False",
663                                 "SupportsTransparentBackColor=False",
664                                 "StandardDoubleClick=True",
665                                 "AllPaintingInWmPaint=False",
666                                 "CacheText=False",
667                                 "EnableNotifyMessage=False",
668                                 "DoubleBuffer=False",
669 #if NET_2_0
670                                 "OptimizedDoubleBuffer=False",
671                                 "UseTextForAccessibility=True"
672 #endif
673                         };
674
675                         Form f = new Form ();
676                         f.ShowInTaskbar = false;
677                         Assert.AreEqual(Form_want, GetStyles(f), "FormStyles");
678                         f.Dispose ();
679                 }
680
681                 [Test]
682                 public void PropertyGridStyleTest ()
683                 {
684                         string[] PropertyGrid_want = {
685                                 "ContainerControl=True",
686                                 "UserPaint=True",
687                                 "Opaque=False",
688                                 "ResizeRedraw=False",
689                                 "FixedWidth=False",
690                                 "FixedHeight=False",
691                                 "StandardClick=True",
692                                 "Selectable=True",
693                                 "UserMouse=False",
694                                 "SupportsTransparentBackColor=False",
695                                 "StandardDoubleClick=True",
696                                 "AllPaintingInWmPaint=False",
697                                 "CacheText=False",
698                                 "EnableNotifyMessage=False",
699                                 "DoubleBuffer=False",
700 #if NET_2_0
701                                 "OptimizedDoubleBuffer=False",
702                                 "UseTextForAccessibility=True"
703 #endif
704                         };
705
706                         Assert.AreEqual(PropertyGrid_want, GetStyles(new PropertyGrid()), "PropertyGridStyles");
707                 }
708
709                 [Test]
710                 public void DomainUpDownStyleTest ()
711                 {
712                         string[] DomainUpDown_want = {
713                                 "ContainerControl=True",
714                                 "UserPaint=True",
715 #if NET_2_0
716                                 "Opaque=True",
717                                 "ResizeRedraw=True",
718 #else
719                                 "Opaque=False",
720                                 "ResizeRedraw=False",
721 #endif
722                                 "FixedWidth=False",
723                                 "FixedHeight=True",
724 #if NET_2_0
725                                 "StandardClick=False",
726 #else
727                                 "StandardClick=True",
728 #endif
729                                 "Selectable=True",
730                                 "UserMouse=False",
731                                 "SupportsTransparentBackColor=False",
732                                 "StandardDoubleClick=True",
733                                 "AllPaintingInWmPaint=False",
734                                 "CacheText=False",
735                                 "EnableNotifyMessage=False",
736                                 "DoubleBuffer=False",
737 #if NET_2_0
738                                 "OptimizedDoubleBuffer=False",
739                                 "UseTextForAccessibility=False"
740 #endif
741                         };
742
743                         Assert.AreEqual(DomainUpDown_want, GetStyles(new DomainUpDown()), "DomainUpDownStyles");
744                 }
745
746                 [Test]
747                 public void NumericUpDownStyleTest ()
748                 {
749                         string[] NumericUpDown_want = {
750                                 "ContainerControl=True",
751                                 "UserPaint=True",
752 #if NET_2_0
753                                 "Opaque=True",
754                                 "ResizeRedraw=True",
755 #else
756                                 "Opaque=False",
757                                 "ResizeRedraw=False",
758 #endif
759                                 "FixedWidth=False",
760                                 "FixedHeight=True",
761 #if NET_2_0
762                                 "StandardClick=False",
763 #else
764                                 "StandardClick=True",
765 #endif
766                                 "Selectable=True",
767                                 "UserMouse=False",
768                                 "SupportsTransparentBackColor=False",
769                                 "StandardDoubleClick=True",
770                                 "AllPaintingInWmPaint=False",
771                                 "CacheText=False",
772                                 "EnableNotifyMessage=False",
773                                 "DoubleBuffer=False",
774 #if NET_2_0
775                                 "OptimizedDoubleBuffer=False",
776                                 "UseTextForAccessibility=False"
777 #endif
778                         };
779
780                         Assert.AreEqual(NumericUpDown_want, GetStyles(new NumericUpDown()), "NumericUpDownStyles");
781                 }
782
783                 [Test]
784                 public void UserControlStyleTest ()
785                 {
786                         string[] UserControl_want = {
787                                 "ContainerControl=True",
788                                 "UserPaint=True",
789                                 "Opaque=False",
790                                 "ResizeRedraw=False",
791                                 "FixedWidth=False",
792                                 "FixedHeight=False",
793                                 "StandardClick=True",
794                                 "Selectable=True",
795                                 "UserMouse=False",
796 #if NET_2_0
797                                 "SupportsTransparentBackColor=True",
798 #else
799                                 "SupportsTransparentBackColor=False",
800 #endif
801                                 "StandardDoubleClick=True",
802                                 "AllPaintingInWmPaint=False",
803                                 "CacheText=False",
804                                 "EnableNotifyMessage=False",
805                                 "DoubleBuffer=False",
806 #if NET_2_0
807                                 "OptimizedDoubleBuffer=False",
808                                 "UseTextForAccessibility=True"
809 #endif
810                         };
811
812                         Assert.AreEqual(UserControl_want, GetStyles(new UserControl()), "UserControlStyles");
813                 }
814
815                 [Test]
816                 public void PanelStyleTest ()
817                 {
818                         string[] Panel_want = {
819                                 "ContainerControl=True",
820                                 "UserPaint=True",
821                                 "Opaque=False",
822                                 "ResizeRedraw=False",
823                                 "FixedWidth=False",
824                                 "FixedHeight=False",
825                                 "StandardClick=True",
826                                 "Selectable=False",
827                                 "UserMouse=False",
828                                 "SupportsTransparentBackColor=True",
829                                 "StandardDoubleClick=True",
830                                 "AllPaintingInWmPaint=False",
831                                 "CacheText=False",
832                                 "EnableNotifyMessage=False",
833                                 "DoubleBuffer=False",
834 #if NET_2_0
835                                 "OptimizedDoubleBuffer=False",
836                                 "UseTextForAccessibility=True"
837 #endif
838                         };
839
840                         Assert.AreEqual(Panel_want, GetStyles(new Panel()), "PanelStyles");
841                 }
842
843                 [Test]
844                 public void TabPageStyleTest ()
845                 {
846                         string[] TabPage_want = {
847                                 "ContainerControl=True",
848                                 "UserPaint=True",
849                                 "Opaque=False",
850                                 "ResizeRedraw=False",
851                                 "FixedWidth=False",
852                                 "FixedHeight=False",
853                                 "StandardClick=True",
854                                 "Selectable=False",
855                                 "UserMouse=False",
856                                 "SupportsTransparentBackColor=True",
857                                 "StandardDoubleClick=True",
858                                 "AllPaintingInWmPaint=False",
859                                 "CacheText=True",
860                                 "EnableNotifyMessage=False",
861                                 "DoubleBuffer=False",
862 #if NET_2_0
863                                 "OptimizedDoubleBuffer=False",
864                                 "UseTextForAccessibility=True"
865 #endif
866                         };
867
868                         Assert.AreEqual(TabPage_want, GetStyles(new TabPage()), "TabPageStyles");
869                 }
870
871                 [Test]
872                 public void HScrollBarStyleTest ()
873                 {
874                         string[] HScrollBar_want = {
875                                 "ContainerControl=False",
876                                 "UserPaint=False",
877                                 "Opaque=False",
878                                 "ResizeRedraw=False",
879                                 "FixedWidth=False",
880                                 "FixedHeight=False",
881                                 "StandardClick=False",
882                                 "Selectable=True",
883                                 "UserMouse=False",
884                                 "SupportsTransparentBackColor=False",
885                                 "StandardDoubleClick=True",
886                                 "AllPaintingInWmPaint=True",
887                                 "CacheText=False",
888                                 "EnableNotifyMessage=False",
889                                 "DoubleBuffer=False",
890 #if NET_2_0
891                                 "OptimizedDoubleBuffer=False",
892                                 "UseTextForAccessibility=False"
893 #endif
894                         };
895
896                         Assert.AreEqual(HScrollBar_want, GetStyles(new HScrollBar()), "HScrollBarStyles");
897                 }
898
899                 [Test]
900                 public void VScrollBarStyleTest ()
901                 {
902                         string[] VScrollBar_want = {
903                                 "ContainerControl=False",
904                                 "UserPaint=False",
905                                 "Opaque=False",
906                                 "ResizeRedraw=False",
907                                 "FixedWidth=False",
908                                 "FixedHeight=False",
909                                 "StandardClick=False",
910                                 "Selectable=True",
911                                 "UserMouse=False",
912                                 "SupportsTransparentBackColor=False",
913                                 "StandardDoubleClick=True",
914                                 "AllPaintingInWmPaint=True",
915                                 "CacheText=False",
916                                 "EnableNotifyMessage=False",
917                                 "DoubleBuffer=False",
918 #if NET_2_0
919                                 "OptimizedDoubleBuffer=False",
920                                 "UseTextForAccessibility=False"
921 #endif
922                         };
923
924                         Assert.AreEqual(VScrollBar_want, GetStyles(new VScrollBar()), "VScrollBarStyles");
925                 }
926
927                 [Test]
928                 public void SplitterStyleTest ()
929                 {
930                         string[] Splitter_want = {
931                                 "ContainerControl=False",
932                                 "UserPaint=True",
933                                 "Opaque=False",
934                                 "ResizeRedraw=False",
935                                 "FixedWidth=False",
936                                 "FixedHeight=False",
937                                 "StandardClick=True",
938                                 "Selectable=False",
939                                 "UserMouse=False",
940                                 "SupportsTransparentBackColor=False",
941                                 "StandardDoubleClick=True",
942                                 "AllPaintingInWmPaint=True",
943                                 "CacheText=False",
944                                 "EnableNotifyMessage=False",
945                                 "DoubleBuffer=False",
946 #if NET_2_0
947                                 "OptimizedDoubleBuffer=False",
948                                 "UseTextForAccessibility=True"
949 #endif
950                         };
951
952                         Assert.AreEqual(Splitter_want, GetStyles(new Splitter()), "SplitterStyles");
953                 }
954
955                 [Test]
956                 public void StatusBarStyleTest ()
957                 {
958                         string[] StatusBar_want = {
959                                 "ContainerControl=False",
960                                 "UserPaint=False",
961                                 "Opaque=False",
962                                 "ResizeRedraw=False",
963                                 "FixedWidth=False",
964                                 "FixedHeight=False",
965                                 "StandardClick=True",
966                                 "Selectable=False",
967                                 "UserMouse=False",
968                                 "SupportsTransparentBackColor=False",
969                                 "StandardDoubleClick=True",
970                                 "AllPaintingInWmPaint=True",
971                                 "CacheText=False",
972                                 "EnableNotifyMessage=False",
973                                 "DoubleBuffer=False",
974 #if NET_2_0
975                                 "OptimizedDoubleBuffer=False",
976                                 "UseTextForAccessibility=True"
977 #endif
978                         };
979
980                         Assert.AreEqual(StatusBar_want, GetStyles(new StatusBar()), "StatusBarStyles");
981                 }
982
983                 [Test]
984                 public void TabControlStyleTest ()
985                 {
986                         string[] TabControl_want = {
987                                 "ContainerControl=False",
988                                 "UserPaint=False",
989                                 "Opaque=False",
990                                 "ResizeRedraw=False",
991                                 "FixedWidth=False",
992                                 "FixedHeight=False",
993                                 "StandardClick=True",
994                                 "Selectable=True",
995                                 "UserMouse=False",
996                                 "SupportsTransparentBackColor=False",
997                                 "StandardDoubleClick=True",
998                                 "AllPaintingInWmPaint=True",
999                                 "CacheText=False",
1000                                 "EnableNotifyMessage=False",
1001                                 "DoubleBuffer=False",
1002 #if NET_2_0
1003                                 "OptimizedDoubleBuffer=False",
1004                                 "UseTextForAccessibility=True"
1005 #endif
1006                         };
1007
1008                         Assert.AreEqual(TabControl_want, GetStyles(new TabControl()), "TabControlStyles");
1009                 }
1010
1011                 [Test]
1012                 public void RichTextBoxStyleTest ()
1013                 {
1014                         string[] RichTextBox_want = {
1015                                 "ContainerControl=False",
1016                                 "UserPaint=False",
1017                                 "Opaque=False",
1018                                 "ResizeRedraw=False",
1019                                 "FixedWidth=False",
1020                                 "FixedHeight=False",
1021                                 "StandardClick=False",
1022                                 "Selectable=True",
1023                                 "UserMouse=False",
1024                                 "SupportsTransparentBackColor=False",
1025 #if NET_2_0
1026                                 "StandardDoubleClick=False",
1027 #else
1028                                 "StandardDoubleClick=True",
1029 #endif
1030                                 "AllPaintingInWmPaint=True",
1031                                 "CacheText=False",
1032                                 "EnableNotifyMessage=False",
1033                                 "DoubleBuffer=False",
1034 #if NET_2_0
1035                                 "OptimizedDoubleBuffer=False",
1036                                 "UseTextForAccessibility=False"
1037 #endif
1038                         };
1039
1040                         Assert.AreEqual(RichTextBox_want, GetStyles(new RichTextBox()), "RichTextBoxStyles");
1041                 }
1042
1043                 [Test]
1044                 public void TextBoxStyleTest ()
1045                 {
1046                         string[] TextBox_want = {
1047                                 "ContainerControl=False",
1048                                 "UserPaint=False",
1049                                 "Opaque=False",
1050                                 "ResizeRedraw=False",
1051                                 "FixedWidth=False",
1052                                 "FixedHeight=True",
1053                                 "StandardClick=False",
1054                                 "Selectable=True",
1055                                 "UserMouse=False",
1056                                 "SupportsTransparentBackColor=False",
1057                                 "StandardDoubleClick=False",
1058                                 "AllPaintingInWmPaint=True",
1059                                 "CacheText=False",
1060                                 "EnableNotifyMessage=False",
1061                                 "DoubleBuffer=False",
1062 #if NET_2_0
1063                                 "OptimizedDoubleBuffer=False",
1064                                 "UseTextForAccessibility=False"
1065 #endif
1066                         };
1067
1068                         Assert.AreEqual(TextBox_want, GetStyles(new TextBox()), "TextBoxStyles");
1069                 }
1070
1071                 [Test]
1072                 public void DataGridTextBoxStyleTest ()
1073                 {
1074                         string[] DataGridTextBox_want = {
1075                                 "ContainerControl=False",
1076                                 "UserPaint=False",
1077                                 "Opaque=False",
1078                                 "ResizeRedraw=False",
1079                                 "FixedWidth=False",
1080                                 "FixedHeight=True",
1081                                 "StandardClick=False",
1082                                 "Selectable=True",
1083                                 "UserMouse=False",
1084                                 "SupportsTransparentBackColor=False",
1085                                 "StandardDoubleClick=False",
1086                                 "AllPaintingInWmPaint=True",
1087                                 "CacheText=False",
1088                                 "EnableNotifyMessage=False",
1089                                 "DoubleBuffer=False",
1090 #if NET_2_0
1091                                 "OptimizedDoubleBuffer=False",
1092                                 "UseTextForAccessibility=False"
1093 #endif
1094                         };
1095
1096                         Assert.AreEqual(DataGridTextBox_want, GetStyles(new DataGridTextBox()), "DataGridTextBoxStyles");
1097                 }
1098
1099                 [Test]
1100                 public void ToolBarStyleTest ()
1101                 {
1102                         string[] ToolBar_want = {
1103                                 "ContainerControl=False",
1104                                 "UserPaint=False",
1105                                 "Opaque=False",
1106                                 "ResizeRedraw=False",
1107                                 "FixedWidth=False",
1108                                 "FixedHeight=True",
1109                                 "StandardClick=True",
1110                                 "Selectable=True",
1111                                 "UserMouse=False",
1112                                 "SupportsTransparentBackColor=False",
1113                                 "StandardDoubleClick=True",
1114                                 "AllPaintingInWmPaint=True",
1115                                 "CacheText=False",
1116                                 "EnableNotifyMessage=False",
1117                                 "DoubleBuffer=False",
1118 #if NET_2_0
1119                                 "OptimizedDoubleBuffer=False",
1120                                 "UseTextForAccessibility=True"
1121 #endif
1122                         };
1123
1124                         Assert.AreEqual(ToolBar_want, GetStyles(new ToolBar()), "ToolBarStyles");
1125                 }
1126
1127                 [Test]
1128                 public void TrackBarStyleTest ()
1129                 {
1130                         string[] TrackBar_want = {
1131                                 "ContainerControl=False",
1132                                 "UserPaint=False",
1133                                 "Opaque=False",
1134                                 "ResizeRedraw=False",
1135                                 "FixedWidth=False",
1136                                 "FixedHeight=False",
1137                                 "StandardClick=True",
1138                                 "Selectable=True",
1139                                 "UserMouse=False",
1140                                 "SupportsTransparentBackColor=False",
1141                                 "StandardDoubleClick=True",
1142                                 "AllPaintingInWmPaint=True",
1143                                 "CacheText=False",
1144                                 "EnableNotifyMessage=False",
1145                                 "DoubleBuffer=False",
1146 #if NET_2_0
1147                                 "OptimizedDoubleBuffer=False",
1148                                 "UseTextForAccessibility=False"
1149 #endif
1150                         };
1151
1152                         Assert.AreEqual(TrackBar_want, GetStyles(new TrackBar()), "TrackBarStyles");
1153                 }
1154
1155                 [Test]
1156                 public void TreeViewStyleTest ()
1157                 {
1158                         string[] TreeView_want = {
1159                                 "ContainerControl=False",
1160                                 "UserPaint=False",
1161                                 "Opaque=False",
1162                                 "ResizeRedraw=False",
1163                                 "FixedWidth=False",
1164                                 "FixedHeight=False",
1165                                 "StandardClick=False",
1166                                 "Selectable=True",
1167                                 "UserMouse=False",
1168                                 "SupportsTransparentBackColor=False",
1169                                 "StandardDoubleClick=True",
1170                                 "AllPaintingInWmPaint=True",
1171                                 "CacheText=False",
1172                                 "EnableNotifyMessage=False",
1173                                 "DoubleBuffer=False",
1174 #if NET_2_0
1175                                 "OptimizedDoubleBuffer=False",
1176                                 "UseTextForAccessibility=False"
1177 #endif
1178                         };
1179
1180                         Assert.AreEqual(TreeView_want, GetStyles(new TreeView()), "TreeViewStyles");
1181                 }
1182         }
1183 }