2005-09-16 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mcs / class / System.Drawing / Test / System.Drawing / TestSystemBrushes.cs
1 // Tests for System.Drawing.SystemBrushes.cs
2 //
3 // Author: Ravindra (rkumar@novell.com)
4 //
5
6 //
7 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
16 // 
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
19 // 
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28
29
30 using NUnit.Framework;
31 using System;
32 using System.Drawing;
33 using System.Security.Permissions;
34
35 namespace MonoTests.System.Drawing
36 {
37         [TestFixture]
38         [SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
39         public class SystemBrushesTest : Assertion
40         {
41                 [TearDown]
42                 public void TearDown () {}
43
44                 [SetUp]
45                 public void SetUp () {}
46
47                 [Test]
48                 public void TestActiveBorder ()
49                 {
50                         SolidBrush brush;
51                         brush = (SolidBrush) SystemBrushes.ActiveBorder;
52                         Assert ("P1#1", brush.Color.IsSystemColor);
53                         AssertEquals ("P1#2", SystemColors.ActiveBorder, brush.Color);
54
55                         try {
56                                 brush.Color = Color.Red;
57                                 Fail ("P1#3: must throw ArgumentException");
58                         } catch (ArgumentException) {
59                                 Assert ("P1#3", true);
60                         }
61
62                         try {
63                                 brush.Color = SystemColors.ActiveBorder;
64                                 Fail ("P1#4: must throw ArgumentException");
65                         } catch (ArgumentException) {
66                                 Assert ("P1#4", true);
67                         }
68
69                         try {
70                                 brush.Dispose();
71                                 Fail ("P1#5: must throw ArgumentException");
72                         } catch (ArgumentException) {
73                                 Assert ("P1#5", true);
74                         }
75                 }
76
77                 [Test]
78                 public void TestActiveCaption ()
79                 {
80                         SolidBrush brush;
81                         brush = (SolidBrush) SystemBrushes.ActiveCaption;
82                         Assert ("P2#1", brush.Color.IsSystemColor);
83                         AssertEquals ("P2#2", SystemColors.ActiveCaption, brush.Color);
84
85                         try {
86                                 brush.Color = Color.Red;
87                                 Fail ("P2#3: must throw ArgumentException");
88                         } catch (Exception e) {
89                                 Assert ("P2#3", e is ArgumentException);
90                         }
91
92                         try {
93                                 brush.Color = SystemColors.ActiveCaption;
94                                 Fail ("P2#4: must throw ArgumentException");
95                         } catch (Exception e) {
96                                 Assert ("P2#4", e is ArgumentException);
97                         }
98
99                         try {
100                                 brush.Dispose();
101                                 Fail ("P2#5: must throw ArgumentException");
102                         } catch (Exception e) {
103                                 Assert ("P2#5", e is ArgumentException);
104                         }
105
106                 }
107
108                 [Test]
109                 public void TestActiveCaptionText ()
110                 {
111                         SolidBrush brush;
112                         brush = (SolidBrush) SystemBrushes.ActiveCaptionText;
113                         Assert ("P3#1", brush.Color.IsSystemColor);
114                         AssertEquals ("P3#2", SystemColors.ActiveCaptionText, brush.Color);
115
116                         try {
117                                 brush.Color = Color.Red;
118                                 Fail ("P3#3: must throw ArgumentException");
119                         } catch (Exception e) {
120                                 Assert ("P3#3", e is ArgumentException);
121                         }
122
123                         try {
124                                 brush.Color = SystemColors.ActiveCaptionText;
125                                 Fail ("P3#4: must throw ArgumentException");
126                         } catch (Exception e) {
127                                 Assert ("P3#4", e is ArgumentException);
128                         }
129
130                         try {
131                                 brush.Dispose();
132                                 Fail ("P3#5: must throw ArgumentException");
133                         } catch (Exception e) {
134                                 Assert ("P3#5", e is ArgumentException);
135                         }
136                 }
137
138                 [Test]
139                 public void TestAppWorkspace ()
140                 {
141                         SolidBrush brush;
142                         brush = (SolidBrush) SystemBrushes.AppWorkspace;
143                         Assert ("P4#1", brush.Color.IsSystemColor);
144                         AssertEquals ("P4#2", SystemColors.AppWorkspace, brush.Color);
145
146                         try {
147                                 brush.Color = Color.Red;
148                                 Fail ("P4#3: must throw ArgumentException");
149                         } catch (Exception e) {
150                                 Assert ("P4#3", e is ArgumentException);
151                         }
152
153                         try {
154                                 brush.Color = SystemColors.AppWorkspace;
155                                 Fail ("P4#4: must throw ArgumentException");
156                         } catch (Exception e) {
157                                 Assert ("P4#4", e is ArgumentException);
158                         }
159
160                         try {
161                                 brush.Dispose();
162                                 Fail ("P4#5: must throw ArgumentException");
163                         } catch (Exception e) {
164                                 Assert ("P4#5", e is ArgumentException);
165                         }
166                 }
167
168                 [Test]
169                 public void TestControl ()
170                 {
171                         SolidBrush brush;
172                         brush = (SolidBrush) SystemBrushes.Control;
173                         Assert ("P5#1", brush.Color.IsSystemColor);
174                         AssertEquals ("P5#2", SystemColors.Control, brush.Color);
175
176                         try {
177                                 brush.Color = Color.Red;
178                                 Fail ("P5#3: must throw ArgumentException");
179                         } catch (Exception e) {
180                                 Assert ("P5#3", e is ArgumentException);
181                         }
182
183                         try {
184                                 brush.Color = SystemColors.Control;
185                                 Fail ("P5#4: must throw ArgumentException");
186                         } catch (Exception e) {
187                                 Assert ("P5#4", e is ArgumentException);
188                         }
189
190                         try {
191                                 brush.Dispose();
192                                 Fail ("P5#5: must throw ArgumentException");
193                         } catch (Exception e) {
194                                 Assert ("P5#5", e is ArgumentException);
195                         }
196
197                 }
198
199                 [Test]
200                 public void TestControlDark ()
201                 {
202                         SolidBrush brush;
203                         brush = (SolidBrush) SystemBrushes.ControlDark;
204                         Assert ("P6#1", brush.Color.IsSystemColor);
205                         AssertEquals ("P6#2", SystemColors.ControlDark, brush.Color);
206
207                         try {
208                                 brush.Color = Color.Red;
209                                 Fail ("P6#3: must throw ArgumentException");
210                         } catch (Exception e) {
211                                 Assert ("P6#3", e is ArgumentException);
212                         }
213
214                         try {
215                                 brush.Color = SystemColors.ControlDark;
216                                 Fail ("P6#4: must throw ArgumentException");
217                         } catch (Exception e) {
218                                 Assert ("P6#4", e is ArgumentException);
219                         }
220
221                         try {
222                                 brush.Dispose();
223                                 Fail ("P6#5: must throw ArgumentException");
224                         } catch (Exception e) {
225                                 Assert ("P6#5", e is ArgumentException);
226                         }
227                 }
228
229                 [Test]
230                 public void TestControlDarkDark ()
231                 {
232                         SolidBrush brush;
233                         brush = (SolidBrush) SystemBrushes.ControlDarkDark;
234                         Assert ("P7#1", brush.Color.IsSystemColor);
235                         AssertEquals ("P7#2", SystemColors.ControlDarkDark, brush.Color);
236
237                         try {
238                                 brush.Color = Color.Red;
239                                 Fail ("P7#3: must throw ArgumentException");
240                         } catch (Exception e) {
241                                 Assert ("P7#3", e is ArgumentException);
242                         }
243
244                         try {
245                                 brush.Color = SystemColors.ControlDarkDark;
246                                 Fail ("P7#4: must throw ArgumentException");
247                         } catch (Exception e) {
248                                 Assert ("P7#4", e is ArgumentException);
249                         }
250
251                         try {
252                                 brush.Dispose();
253                                 Fail ("P7#5: must throw ArgumentException");
254                         } catch (Exception e) {
255                                 Assert ("P7#5", e is ArgumentException);
256                         }
257                 }
258
259                 [Test]
260                 public void TestControlLight ()
261                 {
262                         SolidBrush brush;
263                         brush = (SolidBrush) SystemBrushes.ControlLight;
264                         Assert ("P8#1", brush.Color.IsSystemColor);
265                         AssertEquals ("P8#2", SystemColors.ControlLight, brush.Color);
266
267                         try {
268                                 brush.Color = Color.Red;
269                                 Fail ("P8#3: must throw ArgumentException");
270                         } catch (Exception e) {
271                                 Assert ("P8#3", e is ArgumentException);
272                         }
273
274                         try {
275                                 brush.Color = SystemColors.ControlLight;
276                                 Fail ("P8#4: must throw ArgumentException");
277                         } catch (Exception e) {
278                                 Assert ("P8#4", e is ArgumentException);
279                         }
280
281                         try {
282                                 brush.Dispose();
283                                 Fail ("P8#5: must throw ArgumentException");
284                         } catch (Exception e) {
285                                 Assert ("P8#5", e is ArgumentException);
286                         }
287                 }
288
289                 [Test]
290                 public void TestControlLightLight ()
291                 {
292                         SolidBrush brush;
293                         brush = (SolidBrush) SystemBrushes.ControlLightLight;
294                         Assert ("P9#1", brush.Color.IsSystemColor);
295                         AssertEquals ("P9#2", SystemColors.ControlLightLight, brush.Color);
296
297                         try {
298                                 brush.Color = Color.Red;
299                                 Fail ("P9#3: must throw ArgumentException");
300                         } catch (Exception e) {
301                                 Assert ("P9#3", e is ArgumentException);
302                         }
303
304                         try {
305                                 brush.Color = SystemColors.ControlLightLight;
306                                 Fail ("P9#4: must throw ArgumentException");
307                         } catch (Exception e) {
308                                 Assert ("P9#4", e is ArgumentException);
309                         }
310
311                         try {
312                                 brush.Dispose();
313                                 Fail ("P9#5: must throw ArgumentException");
314                         } catch (Exception e) {
315                                 Assert ("P9#5", e is ArgumentException);
316                         }
317                 }
318
319                 [Test]
320                 public void TestControlText ()
321                 {
322                         SolidBrush brush;
323                         brush = (SolidBrush) SystemBrushes.ControlText;
324                         Assert ("P10#1", brush.Color.IsSystemColor);
325                         AssertEquals ("P10#2", SystemColors.ControlText, brush.Color);
326
327                         try {
328                                 brush.Color = Color.Red;
329                                 Fail ("P10#3: must throw ArgumentException");
330                         } catch (Exception e) {
331                                 Assert ("P10#3", e is ArgumentException);
332                         }
333
334                         try {
335                                 brush.Color = SystemColors.ControlText;
336                                 Fail ("P10#4: must throw ArgumentException");
337                         } catch (Exception e) {
338                                 Assert ("P10#4", e is ArgumentException);
339                         }
340
341                         try {
342                                 brush.Dispose();
343                                 Fail ("P10#5: must throw ArgumentException");
344                         } catch (Exception e) {
345                                 Assert ("P10#5", e is ArgumentException);
346                         }
347                 }
348
349
350                 [Test]
351                 public void TestDesktop ()
352                 {
353                         SolidBrush brush;
354                         brush = (SolidBrush) SystemBrushes.Desktop;
355                         Assert ("P11#1", brush.Color.IsSystemColor);
356                         AssertEquals ("P11#2", SystemColors.Desktop, brush.Color);
357
358                         try {
359                                 brush.Color = Color.Red;
360                                 Fail ("P11#3: must throw ArgumentException");
361                         } catch (Exception e) {
362                                 Assert ("P11#3", e is ArgumentException);
363                         }
364
365                         try {
366                                 brush.Color = SystemColors.Desktop;
367                                 Fail ("P11#4: must throw ArgumentException");
368                         } catch (Exception e) {
369                                 Assert ("P11#4", e is ArgumentException);
370                         }
371
372                         try {
373                                 brush.Dispose();
374                                 Fail ("P11#5: must throw ArgumentException");
375                         } catch (Exception e) {
376                                 Assert ("P11#5", e is ArgumentException);
377                         }
378                 }
379
380                 [Test]
381                 public void TestHighlight ()
382                 {
383                         SolidBrush brush;
384                         brush = (SolidBrush) SystemBrushes.Highlight;
385                         Assert ("P12#1", brush.Color.IsSystemColor);
386                         AssertEquals ("P12#2", SystemColors.Highlight, brush.Color);
387
388                         try {
389                                 brush.Color = Color.Red;
390                                 Fail ("P12#3: must throw ArgumentException");
391                         } catch (Exception e) {
392                                 Assert ("P12#3", e is ArgumentException);
393                         }
394
395                         try {
396                                 brush.Color = SystemColors.Highlight;
397                                 Fail ("P12#4: must throw ArgumentException");
398                         } catch (Exception e) {
399                                 Assert ("P12#4", e is ArgumentException);
400                         }
401
402                         try {
403                                 brush.Dispose();
404                                 Fail ("P12#5: must throw ArgumentException");
405                         } catch (Exception e) {
406                                 Assert ("P12#5", e is ArgumentException);
407                         }
408                 }
409
410                 [Test]
411                 public void TestHighlightText ()
412                 {
413                         SolidBrush brush;
414                         brush = (SolidBrush) SystemBrushes.HighlightText;
415                         Assert ("P13#1", brush.Color.IsSystemColor);
416                         AssertEquals ("P13#2", SystemColors.HighlightText, brush.Color);
417
418                         try {
419                                 brush.Color = Color.Red;
420                                 Fail ("P13#3: must throw ArgumentException");
421                         } catch (Exception e) {
422                                 Assert ("P13#3", e is ArgumentException);
423                         }
424
425                         try {
426                                 brush.Color = SystemColors.HighlightText;
427                                 Fail ("P13#4: must throw ArgumentException");
428                         } catch (Exception e) {
429                                 Assert ("P13#4", e is ArgumentException);
430                         }
431
432                         try {
433                                 brush.Dispose();
434                                 Fail ("P13#5: must throw ArgumentException");
435                         } catch (Exception e) {
436                                 Assert ("P13#5", e is ArgumentException);
437                         }
438                 }
439
440                 [Test]
441                 public void TestHotTrack ()
442                 {
443                         SolidBrush brush;
444                         brush = (SolidBrush) SystemBrushes.HotTrack;
445                         Assert ("P14#1", brush.Color.IsSystemColor);
446                         AssertEquals ("P14#2", SystemColors.HotTrack, brush.Color);
447
448                         try {
449                                 brush.Color = Color.Red;
450                                 Fail ("P14#3: must throw ArgumentException");
451                         } catch (Exception e) {
452                                 Assert ("P14#3", e is ArgumentException);
453                         }
454
455                         try {
456                                 brush.Color = SystemColors.HotTrack;
457                                 Fail ("P14#4: must throw ArgumentException");
458                         } catch (Exception e) {
459                                 Assert ("P14#4", e is ArgumentException);
460                         }
461
462                         try {
463                                 brush.Dispose();
464                                 Fail ("P14#5: must throw ArgumentException");
465                         } catch (Exception e) {
466                                 Assert ("P14#5", e is ArgumentException);
467                         }
468                 }
469
470                 [Test]
471                 public void TestInactiveBorder ()
472                 {
473                         SolidBrush brush;
474                         brush = (SolidBrush) SystemBrushes.InactiveBorder;
475                         Assert ("P15#1", brush.Color.IsSystemColor);
476                         AssertEquals ("P15#2", SystemColors.InactiveBorder, brush.Color);
477
478                         try {
479                                 brush.Color = Color.Red;
480                                 Fail ("P15#3: must throw ArgumentException");
481                         } catch (Exception e) {
482                                 Assert ("P15#3", e is ArgumentException);
483                         }
484
485                         try {
486                                 brush.Color = SystemColors.InactiveBorder;
487                                 Fail ("P15#4: must throw ArgumentException");
488                         } catch (Exception e) {
489                                 Assert ("P15#4", e is ArgumentException);
490                         }
491
492                         try {
493                                 brush.Dispose();
494                                 Fail ("P15#5: must throw ArgumentException");
495                         } catch (Exception e) {
496                                 Assert ("P15#5", e is ArgumentException);
497                         }
498                 }
499
500                 [Test]
501                 public void TestInactiveCaption ()
502                 {
503                         SolidBrush brush;
504                         brush = (SolidBrush) SystemBrushes.InactiveCaption;
505                         Assert ("P16#1", brush.Color.IsSystemColor);
506                         AssertEquals ("P16#2", SystemColors.InactiveCaption, brush.Color);
507
508                         try {
509                                 brush.Color = Color.Red;
510                                 Fail ("P16#3: must throw ArgumentException");
511                         } catch (Exception e) {
512                                 Assert ("P16#3", e is ArgumentException);
513                         }
514
515                         try {
516                                 brush.Color = SystemColors.InactiveCaption;
517                                 Fail ("P16#4: must throw ArgumentException");
518                         } catch (Exception e) {
519                                 Assert ("P16#4", e is ArgumentException);
520                         }
521
522                         try {
523                                 brush.Dispose();
524                                 Fail ("P16#5: must throw ArgumentException");
525                         } catch (Exception e) {
526                                 Assert ("P16#5", e is ArgumentException);
527                         }
528                 }
529
530                 [Test]
531                 public void TestInfo ()
532                 {
533                         SolidBrush brush;
534                         brush = (SolidBrush) SystemBrushes.Info;
535                         Assert ("P17#1", brush.Color.IsSystemColor);
536                         AssertEquals ("P17#2", SystemColors.Info, brush.Color);
537
538                         try {
539                                 brush.Color = Color.Red;
540                                 Fail ("P17#3: must throw ArgumentException");
541                         } catch (Exception e) {
542                                 Assert ("P17#3", e is ArgumentException);
543                         }
544
545                         try {
546                                 brush.Color = SystemColors.Info;
547                                 Fail ("P17#4: must throw ArgumentException");
548                         } catch (Exception e) {
549                                 Assert ("P17#4", e is ArgumentException);
550                         }
551
552                         try {
553                                 brush.Dispose();
554                                 Fail ("P17#5: must throw ArgumentException");
555                         } catch (Exception e) {
556                                 Assert ("P17#5", e is ArgumentException);
557                         }
558                 }
559
560                 [Test]
561                 public void TestMenu ()
562                 {
563                         SolidBrush brush;
564                         brush = (SolidBrush) SystemBrushes.Menu;
565                         Assert ("P18#1", brush.Color.IsSystemColor);
566                         AssertEquals ("P18#2", SystemColors.Menu, brush.Color);
567
568                         try {
569                                 brush.Color = Color.Red;
570                                 Fail ("P18#3: must throw ArgumentException");
571                         } catch (Exception e) {
572                                 Assert ("P18#3", e is ArgumentException);
573                         }
574
575                         try {
576                                 brush.Color = SystemColors.Menu;
577                                 Fail ("P18#4: must throw ArgumentException");
578                         } catch (Exception e) {
579                                 Assert ("P18#4", e is ArgumentException);
580                         }
581
582                         try {
583                                 brush.Dispose();
584                                 Fail ("P18#5: must throw ArgumentException");
585                         } catch (Exception e) {
586                                 Assert ("P18#5", e is ArgumentException);
587                         }
588                 }
589
590                 [Test]
591                 public void TestScrollBar ()
592                 {
593                         SolidBrush brush;
594                         brush = (SolidBrush) SystemBrushes.ScrollBar;
595                         Assert ("P19#1", brush.Color.IsSystemColor);
596                         AssertEquals ("P19#2", SystemColors.ScrollBar, brush.Color);
597
598                         try {
599                                 brush.Color = Color.Red;
600                                 Fail ("P19#3: must throw ArgumentException");
601                         } catch (Exception e) {
602                                 Assert ("P19#3", e is ArgumentException);
603                         }
604
605                         try {
606                                 brush.Color = SystemColors.ScrollBar;
607                                 Fail ("P19#4: must throw ArgumentException");
608                         } catch (Exception e) {
609                                 Assert ("P19#4", e is ArgumentException);
610                         }
611
612                         try {
613                                 brush.Dispose();
614                                 Fail ("P19#5: must throw ArgumentException");
615                         } catch (Exception e) {
616                                 Assert ("P19#5", e is ArgumentException);
617                         }
618                 }
619
620                 [Test]
621                 public void TestWindow ()
622                 {
623                         SolidBrush brush;
624                         brush = (SolidBrush) SystemBrushes.Window;
625                         Assert ("P20#1", brush.Color.IsSystemColor);
626                         AssertEquals ("P20#2", SystemColors.Window, brush.Color);
627
628                         try {
629                                 brush.Color = Color.Red;
630                                 Fail ("P20#3: must throw ArgumentException");
631                         } catch (Exception e) {
632                                 Assert ("P20#3", e is ArgumentException);
633                         }
634
635                         try {
636                                 brush.Color = SystemColors.Window;
637                                 Fail ("P20#4: must throw ArgumentException");
638                         } catch (Exception e) {
639                                 Assert ("P20#4", e is ArgumentException);
640                         }
641
642                         try {
643                                 brush.Dispose();
644                                 Fail ("P20#5: must throw ArgumentException");
645                         } catch (Exception e) {
646                                 Assert ("P20#5", e is ArgumentException);
647                         }
648                 }
649
650                 [Test]
651                 public void TestWindowText ()
652                 {
653                         SolidBrush brush;
654                         brush = (SolidBrush) SystemBrushes.WindowText;
655                         Assert ("P21#1", brush.Color.IsSystemColor);
656                         AssertEquals ("P21#2", SystemColors.WindowText, brush.Color);
657
658                         try {
659                                 brush.Color = Color.Red;
660                                 Fail ("P21#3: must throw ArgumentException");
661                         } catch (Exception e) {
662                                 Assert ("P21#3", e is ArgumentException);
663                         }
664
665                         try {
666                                 brush.Color = SystemColors.WindowText;
667                                 Fail ("P21#4: must throw ArgumentException");
668                         } catch (Exception e) {
669                                 Assert ("P21#4", e is ArgumentException);
670                         }
671
672                         try {
673                                 brush.Dispose();
674                                 Fail ("P21#5: must throw ArgumentException");
675                         } catch (Exception e) {
676                                 Assert ("P21#5", e is ArgumentException);
677                         }
678                 }
679
680                 [Test]
681                 public void TestFromSystemColor ()
682                 {
683                         SolidBrush brush;
684
685                         brush = (SolidBrush) SystemBrushes.FromSystemColor (SystemColors.Menu);
686                         AssertEquals ("M1#1", SystemColors.Menu, brush.Color);
687
688                         try {
689                                 brush.Color = Color.Red;
690                                 Fail ("M1#2: must throw ArgumentException");
691                         } catch (Exception e) {
692                                 Assert ("M1#2", e is ArgumentException);
693                         }
694
695                         try {
696                                 brush.Color = SystemColors.Menu;
697                                 Fail ("M1#3: must throw ArgumentException");
698                         } catch (Exception e) {
699                                 Assert ("M1#3", e is ArgumentException);
700                         }
701
702                         try {
703                                 brush.Dispose();
704                                 Fail ("M1#4: must throw ArgumentException");
705                         } catch (Exception e) {
706                                 Assert ("M1#4", e is ArgumentException);
707                         }
708
709
710                         try {
711                                 brush = (SolidBrush) SystemBrushes.FromSystemColor (Color.Red);
712                                 Fail ("M2#1: must throw ArgumentException");
713                         } catch (Exception e) {
714                                 Assert ("M2#1", e is ArgumentException);
715                         }
716                 }
717         }
718 }