1 // Tests for System.Drawing.Pens.cs
4 // Ravindra (rkumar@novell.com)
8 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using NUnit.Framework;
34 using System.Drawing.Drawing2D;
35 using System.Security.Permissions;
37 namespace MonoTests.System.Drawing
40 [SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
41 public class PensTest : Assertion
44 public void SetUp () { }
47 public void TearDown () { }
50 public void TestEquals ()
55 AssertEquals ("Equals", true, pen1.Equals (pen2));
59 public void TestAliceBlue ()
61 Pen pen = Pens.AliceBlue;
62 AssertEquals ("P1#1", pen.PenType, PenType.SolidColor);
63 AssertEquals ("P1#2", pen.Color, Color.AliceBlue);
66 pen.Color = Color.AliceBlue;
67 Fail ("P1#3: must throw ArgumentException");
68 } catch (ArgumentException) {
69 Assert ("P1#3", true);
74 public void TestAntiqueWhite ()
76 Pen pen = Pens.AntiqueWhite;
77 AssertEquals ("P2#1", pen.PenType, PenType.SolidColor);
78 AssertEquals ("P2#2", pen.Color, Color.AntiqueWhite);
81 pen.Color = Color.AntiqueWhite;
82 Fail ("P2#3: must throw ArgumentException");
83 } catch (ArgumentException) {
84 Assert ("P2#3", true);
89 public void TestAqua ()
92 AssertEquals ("P3#1", pen.PenType, PenType.SolidColor);
93 AssertEquals ("P3#2", pen.Color, Color.Aqua);
96 pen.Color = Color.Aqua;
97 Fail ("P3#3: must throw ArgumentException");
98 } catch (ArgumentException) {
99 Assert ("P3#3", true);
104 public void TestAquamarine ()
106 Pen pen = Pens.Aquamarine;
107 AssertEquals ("P4#1", pen.PenType, PenType.SolidColor);
108 AssertEquals ("P4#2", pen.Color, Color.Aquamarine);
111 pen.Color = Color.Aquamarine;
112 Fail ("P4#3: must throw ArgumentException");
113 } catch (ArgumentException) {
114 Assert ("P4#3", true);
119 public void TestAzure ()
121 Pen pen = Pens.Azure;
122 AssertEquals ("P5#1", pen.PenType, PenType.SolidColor);
123 AssertEquals ("P5#2", pen.Color, Color.Azure);
126 pen.Color = Color.Azure;
127 Fail ("P5#3: must throw ArgumentException");
128 } catch (ArgumentException) {
129 Assert ("P5#3", true);
134 public void TestBeige ()
136 Pen pen = Pens.Beige;
137 AssertEquals ("P6#1", pen.PenType, PenType.SolidColor);
138 AssertEquals ("P6#2", pen.Color, Color.Beige);
141 pen.Color = Color.Beige;
142 Fail ("P6#3: must throw ArgumentException");
143 } catch (ArgumentException) {
144 Assert ("P6#3", true);
149 public void TestBisque ()
151 Pen pen = Pens.Bisque;
152 AssertEquals ("P7#1", pen.PenType, PenType.SolidColor);
153 AssertEquals ("P7#2", pen.Color, Color.Bisque);
156 pen.Color = Color.Bisque;
157 Fail ("P7#3: must throw ArgumentException");
158 } catch (ArgumentException) {
159 Assert ("P7#3", true);
164 public void TestBlack ()
166 Pen pen = Pens.Black;
167 AssertEquals ("P8#1", pen.PenType, PenType.SolidColor);
168 AssertEquals ("P8#2", pen.Color, Color.Black);
171 pen.Color = Color.Black;
172 Fail ("P8#3: must throw ArgumentException");
173 } catch (ArgumentException) {
174 Assert ("P8#3", true);
179 public void TestBlanchedAlmond ()
181 Pen pen = Pens.BlanchedAlmond;
182 AssertEquals ("P9#1", pen.PenType, PenType.SolidColor);
183 AssertEquals ("P9#2", pen.Color, Color.BlanchedAlmond);
186 pen.Color = Color.BlanchedAlmond;
187 Fail ("P9#3: must throw ArgumentException");
188 } catch (ArgumentException) {
189 Assert ("P9#3", true);
194 public void TestBlue ()
197 AssertEquals ("P10#1", pen.PenType, PenType.SolidColor);
198 AssertEquals ("P10#2", pen.Color, Color.Blue);
201 pen.Color = Color.Blue;
202 Fail ("P10#3: must throw ArgumentException");
203 } catch (ArgumentException) {
204 Assert ("P10#3", true);
209 public void TestBlueViolet ()
211 Pen pen = Pens.BlueViolet;
212 AssertEquals ("P11#1", pen.PenType, PenType.SolidColor);
213 AssertEquals ("P11#2", pen.Color, Color.BlueViolet);
216 pen.Color = Color.BlueViolet;
217 Fail ("P11#3: must throw ArgumentException");
218 } catch (ArgumentException) {
219 Assert ("P11#3", true);
224 public void TestBrown ()
226 Pen pen = Pens.Brown;
227 AssertEquals ("P12#1", pen.PenType, PenType.SolidColor);
228 AssertEquals ("P12#2", pen.Color, Color.Brown);
231 pen.Color = Color.Brown;
232 Fail ("P12#3: must throw ArgumentException");
233 } catch (ArgumentException) {
234 Assert ("P12#3", true);
239 public void TestBurlyWood ()
241 Pen pen = Pens.BurlyWood;
242 AssertEquals ("P13#1", pen.PenType, PenType.SolidColor);
243 AssertEquals ("P13#2", pen.Color, Color.BurlyWood);
246 pen.Color = Color.BurlyWood;
247 Fail ("P13#3: must throw ArgumentException");
248 } catch (ArgumentException) {
249 Assert ("P13#3", true);
254 public void TestCadetBlue ()
256 Pen pen = Pens.CadetBlue;
257 AssertEquals ("P14#1", pen.PenType, PenType.SolidColor);
258 AssertEquals ("P14#2", pen.Color, Color.CadetBlue);
261 pen.Color = Color.CadetBlue;
262 Fail ("P14#3: must throw ArgumentException");
263 } catch (ArgumentException) {
264 Assert ("P14#3", true);
269 public void TestChartreuse ()
271 Pen pen = Pens.Chartreuse;
272 AssertEquals ("P15#1", pen.PenType, PenType.SolidColor);
273 AssertEquals ("P15#2", pen.Color, Color.Chartreuse);
276 pen.Color = Color.Chartreuse;
277 Fail ("P15#3: must throw ArgumentException");
278 } catch (ArgumentException) {
279 Assert ("P15#3", true);
284 public void TestChocolate ()
286 Pen pen = Pens.Chocolate;
287 AssertEquals ("P16#1", pen.PenType, PenType.SolidColor);
288 AssertEquals ("P16#2", pen.Color, Color.Chocolate);
291 pen.Color = Color.Chocolate;
292 Fail ("P16#3: must throw ArgumentException");
293 } catch (ArgumentException) {
294 Assert ("P16#3", true);
299 public void TestCoral ()
301 Pen pen = Pens.Coral;
302 AssertEquals ("P17#1", pen.PenType, PenType.SolidColor);
303 AssertEquals ("P17#2", pen.Color, Color.Coral);
306 pen.Color = Color.Coral;
307 Fail ("P17#3: must throw ArgumentException");
308 } catch (ArgumentException) {
309 Assert ("P17#3", true);
314 public void TestCornflowerBlue ()
316 Pen pen = Pens.CornflowerBlue;
317 AssertEquals ("P18#1", pen.PenType, PenType.SolidColor);
318 AssertEquals ("P18#2", pen.Color, Color.CornflowerBlue);
321 pen.Color = Color.CornflowerBlue;
322 Fail ("P18#3: must throw ArgumentException");
323 } catch (ArgumentException) {
324 Assert ("P18#3", true);
329 public void TestCornsilk ()
331 Pen pen = Pens.Cornsilk;
332 AssertEquals ("P19#1", pen.PenType, PenType.SolidColor);
333 AssertEquals ("P19#2", pen.Color, Color.Cornsilk);
336 pen.Color = Color.Cornsilk;
337 Fail ("P19#3: must throw ArgumentException");
338 } catch (ArgumentException) {
339 Assert ("P19#3", true);
344 public void TestCrimson ()
346 Pen pen = Pens.Crimson;
347 AssertEquals ("P20#1", pen.PenType, PenType.SolidColor);
348 AssertEquals ("P20#2", pen.Color, Color.Crimson);
351 pen.Color = Color.Crimson;
352 Fail ("P20#3: must throw ArgumentException");
353 } catch (ArgumentException) {
354 Assert ("P20#3", true);
359 public void TestCyan ()
362 AssertEquals ("P21#1", pen.PenType, PenType.SolidColor);
363 AssertEquals ("P21#2", pen.Color, Color.Cyan);
366 pen.Color = Color.Cyan;
367 Fail ("P21#3: must throw ArgumentException");
368 } catch (ArgumentException) {
369 Assert ("P21#3", true);
374 public void TestDarkBlue ()
376 Pen pen = Pens.DarkBlue;
377 AssertEquals ("P22#1", pen.PenType, PenType.SolidColor);
378 AssertEquals ("P22#2", pen.Color, Color.DarkBlue);
381 pen.Color = Color.DarkBlue;
382 Fail ("P22#3: must throw ArgumentException");
383 } catch (ArgumentException) {
384 Assert ("P22#3", true);
389 public void TestDarkCyan ()
391 Pen pen = Pens.DarkCyan;
392 AssertEquals ("P23#1", pen.PenType, PenType.SolidColor);
393 AssertEquals ("P23#2", pen.Color, Color.DarkCyan);
396 pen.Color = Color.DarkCyan;
397 Fail ("P23#3: must throw ArgumentException");
398 } catch (ArgumentException) {
399 Assert ("P23#3", true);
404 public void TestDarkGoldenrod ()
406 Pen pen = Pens.DarkGoldenrod;
407 AssertEquals ("P24#1", pen.PenType, PenType.SolidColor);
408 AssertEquals ("P24#2", pen.Color, Color.DarkGoldenrod);
411 pen.Color = Color.DarkGoldenrod;
412 Fail ("P24#3: must throw ArgumentException");
413 } catch (ArgumentException) {
414 Assert ("P24#3", true);
419 public void TestDarkGray ()
421 Pen pen = Pens.DarkGray;
422 AssertEquals ("P25#1", pen.PenType, PenType.SolidColor);
423 AssertEquals ("P25#2", pen.Color, Color.DarkGray);
426 pen.Color = Color.DarkGray;
427 Fail ("P25#3: must throw ArgumentException");
428 } catch (ArgumentException) {
429 Assert ("P25#3", true);
434 public void TestDarkGreen ()
436 Pen pen = Pens.DarkGreen;
437 AssertEquals ("P26#1", pen.PenType, PenType.SolidColor);
438 AssertEquals ("P26#2", pen.Color, Color.DarkGreen);
441 pen.Color = Color.DarkGreen;
442 Fail ("P26#3: must throw ArgumentException");
443 } catch (ArgumentException) {
444 Assert ("P26#3", true);
449 public void TestDarkKhaki ()
451 Pen pen = Pens.DarkKhaki;
452 AssertEquals ("P27#1", pen.PenType, PenType.SolidColor);
453 AssertEquals ("P27#2", pen.Color, Color.DarkKhaki);
456 pen.Color = Color.DarkKhaki;
457 Fail ("P27#3: must throw ArgumentException");
458 } catch (ArgumentException) {
459 Assert ("P27#3", true);
464 public void TestDarkMagenta ()
466 Pen pen = Pens.DarkMagenta;
467 AssertEquals ("P28#1", pen.PenType, PenType.SolidColor);
468 AssertEquals ("P28#2", pen.Color, Color.DarkMagenta);
471 pen.Color = Color.DarkMagenta;
472 Fail ("P28#3: must throw ArgumentException");
473 } catch (ArgumentException) {
474 Assert ("P28#3", true);
479 public void TestDarkOliveGreen ()
481 Pen pen = Pens.DarkOliveGreen;
482 AssertEquals ("P29#1", pen.PenType, PenType.SolidColor);
483 AssertEquals ("P29#2", pen.Color, Color.DarkOliveGreen);
486 pen.Color = Color.DarkOliveGreen;
487 Fail ("P29#3: must throw ArgumentException");
488 } catch (ArgumentException) {
489 Assert ("P29#3", true);
494 public void TestDarkOrange ()
496 Pen pen = Pens.DarkOrange;
497 AssertEquals ("P30#1", pen.PenType, PenType.SolidColor);
498 AssertEquals ("P30#2", pen.Color, Color.DarkOrange);
501 pen.Color = Color.DarkOrange;
502 Fail ("P30#3: must throw ArgumentException");
503 } catch (ArgumentException) {
504 Assert ("P30#3", true);
509 public void TestDarkOrchid ()
511 Pen pen = Pens.DarkOrchid;
512 AssertEquals ("P31#1", pen.PenType, PenType.SolidColor);
513 AssertEquals ("P31#2", pen.Color, Color.DarkOrchid);
516 pen.Color = Color.DarkOrchid;
517 Fail ("P31#3: must throw ArgumentException");
518 } catch (ArgumentException) {
519 Assert ("P31#3", true);
524 public void TestDarkRed ()
526 Pen pen = Pens.DarkRed;
527 AssertEquals ("P32#1", pen.PenType, PenType.SolidColor);
528 AssertEquals ("P32#2", pen.Color, Color.DarkRed);
531 pen.Color = Color.DarkRed;
532 Fail ("P32#3: must throw ArgumentException");
533 } catch (ArgumentException) {
534 Assert ("P32#3", true);
539 public void TestDarkSalmon ()
541 Pen pen = Pens.DarkSalmon;
542 AssertEquals ("P33#1", pen.PenType, PenType.SolidColor);
543 AssertEquals ("P33#2", pen.Color, Color.DarkSalmon);
546 pen.Color = Color.DarkSalmon;
547 Fail ("P33#3: must throw ArgumentException");
548 } catch (ArgumentException) {
549 Assert ("P33#3", true);
554 public void TestDarkSeaGreen ()
556 Pen pen = Pens.DarkSeaGreen;
557 AssertEquals ("P34#1", pen.PenType, PenType.SolidColor);
558 AssertEquals ("P34#2", pen.Color, Color.DarkSeaGreen);
561 pen.Color = Color.DarkSeaGreen;
562 Fail ("P34#3: must throw ArgumentException");
563 } catch (ArgumentException) {
564 Assert ("P34#3", true);
569 public void TestDarkSlateBlue ()
571 Pen pen = Pens.DarkSlateBlue;
572 AssertEquals ("P35#1", pen.PenType, PenType.SolidColor);
573 AssertEquals ("P35#2", pen.Color, Color.DarkSlateBlue);
576 pen.Color = Color.DarkSlateBlue;
577 Fail ("P35#3: must throw ArgumentException");
578 } catch (ArgumentException) {
579 Assert ("P35#3", true);
584 public void TestDarkSlateGray ()
586 Pen pen = Pens.DarkSlateGray;
587 AssertEquals ("P36#1", pen.PenType, PenType.SolidColor);
588 AssertEquals ("P36#2", pen.Color, Color.DarkSlateGray);
591 pen.Color = Color.DarkSlateGray;
592 Fail ("P36#3: must throw ArgumentException");
593 } catch (ArgumentException) {
594 Assert ("P36#3", true);
599 public void TestDarkTurquoise ()
601 Pen pen = Pens.DarkTurquoise;
602 AssertEquals ("P37#1", pen.PenType, PenType.SolidColor);
603 AssertEquals ("P37#2", pen.Color, Color.DarkTurquoise);
606 pen.Color = Color.DarkTurquoise;
607 Fail ("P37#3: must throw ArgumentException");
608 } catch (ArgumentException) {
609 Assert ("P37#3", true);
614 public void TestDarkViolet ()
616 Pen pen = Pens.DarkViolet;
617 AssertEquals ("P38#1", pen.PenType, PenType.SolidColor);
618 AssertEquals ("P38#2", pen.Color, Color.DarkViolet);
621 pen.Color = Color.DarkViolet;
622 Fail ("P38#3: must throw ArgumentException");
623 } catch (ArgumentException) {
624 Assert ("P38#3", true);
629 public void TestDeepPink ()
631 Pen pen = Pens.DeepPink;
632 AssertEquals ("P39#1", pen.PenType, PenType.SolidColor);
633 AssertEquals ("P39#2", pen.Color, Color.DeepPink);
636 pen.Color = Color.DeepPink;
637 Fail ("P39#3: must throw ArgumentException");
638 } catch (ArgumentException) {
639 Assert ("P39#3", true);
644 public void TestDeepSkyBlue ()
646 Pen pen = Pens.DeepSkyBlue;
647 AssertEquals ("P40#1", pen.PenType, PenType.SolidColor);
648 AssertEquals ("P40#2", pen.Color, Color.DeepSkyBlue);
651 pen.Color = Color.DeepSkyBlue;
652 Fail ("P40#3: must throw ArgumentException");
653 } catch (ArgumentException) {
654 Assert ("P40#3", true);
659 public void TestDimGray ()
661 Pen pen = Pens.DimGray;
662 AssertEquals ("P41#1", pen.PenType, PenType.SolidColor);
663 AssertEquals ("P41#2", pen.Color, Color.DimGray);
666 pen.Color = Color.DimGray;
667 Fail ("P41#3: must throw ArgumentException");
668 } catch (ArgumentException) {
669 Assert ("P41#3", true);
674 public void TestDodgerBlue ()
676 Pen pen = Pens.DodgerBlue;
677 AssertEquals ("P42#1", pen.PenType, PenType.SolidColor);
678 AssertEquals ("P42#2", pen.Color, Color.DodgerBlue);
681 pen.Color = Color.DodgerBlue;
682 Fail ("P42#3: must throw ArgumentException");
683 } catch (ArgumentException) {
684 Assert ("P42#3", true);
689 public void TestFirebrick ()
691 Pen pen = Pens.Firebrick;
692 AssertEquals ("P43#1", pen.PenType, PenType.SolidColor);
693 AssertEquals ("P43#2", pen.Color, Color.Firebrick);
696 pen.Color = Color.Firebrick;
697 Fail ("P43#3: must throw ArgumentException");
698 } catch (ArgumentException) {
699 Assert ("P43#3", true);
704 public void TestFloralWhite ()
706 Pen pen = Pens.FloralWhite;
707 AssertEquals ("P44#1", pen.PenType, PenType.SolidColor);
708 AssertEquals ("P44#2", pen.Color, Color.FloralWhite);
711 pen.Color = Color.FloralWhite;
712 Fail ("P44#3: must throw ArgumentException");
713 } catch (ArgumentException) {
714 Assert ("P44#3", true);
719 public void TestForestGreen ()
721 Pen pen = Pens.ForestGreen;
722 AssertEquals ("P45#1", pen.PenType, PenType.SolidColor);
723 AssertEquals ("P45#2", pen.Color, Color.ForestGreen);
726 pen.Color = Color.ForestGreen;
727 Fail ("P45#3: must throw ArgumentException");
728 } catch (ArgumentException) {
729 Assert ("P45#3", true);
734 public void TestFuchsia ()
736 Pen pen = Pens.Fuchsia;
737 AssertEquals ("P46#1", pen.PenType, PenType.SolidColor);
738 AssertEquals ("P46#2", pen.Color, Color.Fuchsia);
741 pen.Color = Color.Fuchsia;
742 Fail ("P46#3: must throw ArgumentException");
743 } catch (ArgumentException) {
744 Assert ("P46#3", true);
749 public void TestGainsboro ()
751 Pen pen = Pens.Gainsboro;
752 AssertEquals ("P47#1", pen.PenType, PenType.SolidColor);
753 AssertEquals ("P47#2", pen.Color, Color.Gainsboro);
756 pen.Color = Color.Gainsboro;
757 Fail ("P47#3: must throw ArgumentException");
758 } catch (ArgumentException) {
759 Assert ("P47#3", true);
764 public void TestGhostWhite ()
766 Pen pen = Pens.GhostWhite;
767 AssertEquals ("P48#1", pen.PenType, PenType.SolidColor);
768 AssertEquals ("P48#2", pen.Color, Color.GhostWhite);
771 pen.Color = Color.GhostWhite;
772 Fail ("P48#3: must throw ArgumentException");
773 } catch (ArgumentException) {
774 Assert ("P48#3", true);
779 public void TestGold ()
782 AssertEquals ("P49#1", pen.PenType, PenType.SolidColor);
783 AssertEquals ("P49#2", pen.Color, Color.Gold);
786 pen.Color = Color.Gold;
787 Fail ("P49#3: must throw ArgumentException");
788 } catch (ArgumentException) {
789 Assert ("P49#3", true);
794 public void TestGoldenrod ()
796 Pen pen = Pens.Goldenrod;
797 AssertEquals ("P50#1", pen.PenType, PenType.SolidColor);
798 AssertEquals ("P50#2", pen.Color, Color.Goldenrod);
801 pen.Color = Color.Goldenrod;
802 Fail ("P50#3: must throw ArgumentException");
803 } catch (ArgumentException) {
804 Assert ("P50#3", true);
809 public void TestGray ()
812 AssertEquals ("P51#1", pen.PenType, PenType.SolidColor);
813 AssertEquals ("P51#2", pen.Color, Color.Gray);
816 pen.Color = Color.Gray;
817 Fail ("P51#3: must throw ArgumentException");
818 } catch (ArgumentException) {
819 Assert ("P51#3", true);
824 public void TestGreen ()
826 Pen pen = Pens.Green;
827 AssertEquals ("P52#1", pen.PenType, PenType.SolidColor);
828 AssertEquals ("P52#2", pen.Color, Color.Green);
831 pen.Color = Color.Green;
832 Fail ("P52#3: must throw ArgumentException");
833 } catch (ArgumentException) {
834 Assert ("P52#3", true);
839 public void TestGreenYellow ()
841 Pen pen = Pens.GreenYellow;
842 AssertEquals ("P53#1", pen.PenType, PenType.SolidColor);
843 AssertEquals ("P53#2", pen.Color, Color.GreenYellow);
846 pen.Color = Color.GreenYellow;
847 Fail ("P53#3: must throw ArgumentException");
848 } catch (ArgumentException) {
849 Assert ("P53#3", true);
854 public void TestHoneydew ()
856 Pen pen = Pens.Honeydew;
857 AssertEquals ("P54#1", pen.PenType, PenType.SolidColor);
858 AssertEquals ("P54#2", pen.Color, Color.Honeydew);
861 pen.Color = Color.Honeydew;
862 Fail ("P54#3: must throw ArgumentException");
863 } catch (ArgumentException) {
864 Assert ("P54#3", true);
869 public void TestHotPink ()
871 Pen pen = Pens.HotPink;
872 AssertEquals ("P55#1", pen.PenType, PenType.SolidColor);
873 AssertEquals ("P55#2", pen.Color, Color.HotPink);
876 pen.Color = Color.HotPink;
877 Fail ("P55#3: must throw ArgumentException");
878 } catch (ArgumentException) {
879 Assert ("P55#3", true);
884 public void TestIndianRed ()
886 Pen pen = Pens.IndianRed;
887 AssertEquals ("P56#1", pen.PenType, PenType.SolidColor);
888 AssertEquals ("P56#2", pen.Color, Color.IndianRed);
891 pen.Color = Color.IndianRed;
892 Fail ("P56#3: must throw ArgumentException");
893 } catch (ArgumentException) {
894 Assert ("P56#3", true);
899 public void TestIndigo ()
901 Pen pen = Pens.Indigo;
902 AssertEquals ("P57#1", pen.PenType, PenType.SolidColor);
903 AssertEquals ("P57#2", pen.Color, Color.Indigo);
906 pen.Color = Color.Indigo;
907 Fail ("P57#3: must throw ArgumentException");
908 } catch (ArgumentException) {
909 Assert ("P57#3", true);
914 public void TestIvory ()
916 Pen pen = Pens.Ivory;
917 AssertEquals ("P58#1", pen.PenType, PenType.SolidColor);
918 AssertEquals ("P58#2", pen.Color, Color.Ivory);
921 pen.Color = Color.Ivory;
922 Fail ("P58#3: must throw ArgumentException");
923 } catch (ArgumentException) {
924 Assert ("P58#3", true);
929 public void TestKhaki ()
931 Pen pen = Pens.Khaki;
932 AssertEquals ("P59#1", pen.PenType, PenType.SolidColor);
933 AssertEquals ("P59#2", pen.Color, Color.Khaki);
936 pen.Color = Color.Khaki;
937 Fail ("P59#3: must throw ArgumentException");
938 } catch (ArgumentException) {
939 Assert ("P59#3", true);
944 public void TestLavender ()
946 Pen pen = Pens.Lavender;
947 AssertEquals ("P60#1", pen.PenType, PenType.SolidColor);
948 AssertEquals ("P60#2", pen.Color, Color.Lavender);
951 pen.Color = Color.Lavender;
952 Fail ("P60#3: must throw ArgumentException");
953 } catch (ArgumentException) {
954 Assert ("P60#3", true);
959 public void TestLavenderBlush ()
961 Pen pen = Pens.LavenderBlush;
962 AssertEquals ("P61#1", pen.PenType, PenType.SolidColor);
963 AssertEquals ("P61#2", pen.Color, Color.LavenderBlush);
966 pen.Color = Color.LavenderBlush;
967 Fail ("P61#3: must throw ArgumentException");
968 } catch (ArgumentException) {
969 Assert ("P61#3", true);
974 public void TestLawnGreen ()
976 Pen pen = Pens.LawnGreen;
977 AssertEquals ("P62#1", pen.PenType, PenType.SolidColor);
978 AssertEquals ("P62#2", pen.Color, Color.LawnGreen);
981 pen.Color = Color.LawnGreen;
982 Fail ("P62#3: must throw ArgumentException");
983 } catch (ArgumentException) {
984 Assert ("P62#3", true);
989 public void TestLemonChiffon ()
991 Pen pen = Pens.LemonChiffon;
992 AssertEquals ("P63#1", pen.PenType, PenType.SolidColor);
993 AssertEquals ("P63#2", pen.Color, Color.LemonChiffon);
996 pen.Color = Color.LemonChiffon;
997 Fail ("P63#3: must throw ArgumentException");
998 } catch (ArgumentException) {
999 Assert ("P63#3", true);
1004 public void TestLightBlue ()
1006 Pen pen = Pens.LightBlue;
1007 AssertEquals ("P64#1", pen.PenType, PenType.SolidColor);
1008 AssertEquals ("P64#2", pen.Color, Color.LightBlue);
1011 pen.Color = Color.LightBlue;
1012 Fail ("P64#3: must throw ArgumentException");
1013 } catch (ArgumentException) {
1014 Assert ("P64#3", true);
1019 public void TestLightCoral ()
1021 Pen pen = Pens.LightCoral;
1022 AssertEquals ("P65#1", pen.PenType, PenType.SolidColor);
1023 AssertEquals ("P65#2", pen.Color, Color.LightCoral);
1026 pen.Color = Color.LightCoral;
1027 Fail ("P65#3: must throw ArgumentException");
1028 } catch (ArgumentException) {
1029 Assert ("P65#3", true);
1034 public void TestLightCyan ()
1036 Pen pen = Pens.LightCyan;
1037 AssertEquals ("P66#1", pen.PenType, PenType.SolidColor);
1038 AssertEquals ("P66#2", pen.Color, Color.LightCyan);
1041 pen.Color = Color.LightCyan;
1042 Fail ("P66#3: must throw ArgumentException");
1043 } catch (ArgumentException) {
1044 Assert ("P66#3", true);
1049 public void TestLightGoldenrodYellow ()
1051 Pen pen = Pens.LightGoldenrodYellow;
1052 AssertEquals ("P67#1", pen.PenType, PenType.SolidColor);
1053 AssertEquals ("P67#2", pen.Color, Color.LightGoldenrodYellow);
1056 pen.Color = Color.LightGoldenrodYellow;
1057 Fail ("P67#3: must throw ArgumentException");
1058 } catch (ArgumentException) {
1059 Assert ("P67#3", true);
1064 public void TestLightGray ()
1066 Pen pen = Pens.LightGray;
1067 AssertEquals ("P68#1", pen.PenType, PenType.SolidColor);
1068 AssertEquals ("P68#2", pen.Color, Color.LightGray);
1071 pen.Color = Color.LightGray;
1072 Fail ("P68#3: must throw ArgumentException");
1073 } catch (ArgumentException) {
1074 Assert ("P68#3", true);
1079 public void TestLightGreen ()
1081 Pen pen = Pens.LightGreen;
1082 AssertEquals ("P69#1", pen.PenType, PenType.SolidColor);
1083 AssertEquals ("P69#2", pen.Color, Color.LightGreen);
1086 pen.Color = Color.LightGreen;
1087 Fail ("P69#3: must throw ArgumentException");
1088 } catch (ArgumentException) {
1089 Assert ("P69#3", true);
1094 public void TestLightPink ()
1096 Pen pen = Pens.LightPink;
1097 AssertEquals ("P70#1", pen.PenType, PenType.SolidColor);
1098 AssertEquals ("P70#2", pen.Color, Color.LightPink);
1101 pen.Color = Color.LightPink;
1102 Fail ("P70#3: must throw ArgumentException");
1103 } catch (ArgumentException) {
1104 Assert ("P70#3", true);
1109 public void TestLightSalmon ()
1111 Pen pen = Pens.LightSalmon;
1112 AssertEquals ("P71#1", pen.PenType, PenType.SolidColor);
1113 AssertEquals ("P71#2", pen.Color, Color.LightSalmon);
1116 pen.Color = Color.LightSalmon;
1117 Fail ("P71#3: must throw ArgumentException");
1118 } catch (ArgumentException) {
1119 Assert ("P71#3", true);
1124 public void TestLightSeaGreen ()
1126 Pen pen = Pens.LightSeaGreen;
1127 AssertEquals ("P72#1", pen.PenType, PenType.SolidColor);
1128 AssertEquals ("P72#2", pen.Color, Color.LightSeaGreen);
1131 pen.Color = Color.LightSeaGreen;
1132 Fail ("P72#3: must throw ArgumentException");
1133 } catch (ArgumentException) {
1134 Assert ("P72#3", true);
1139 public void TestLightSkyBlue ()
1141 Pen pen = Pens.LightSkyBlue;
1142 AssertEquals ("P73#1", pen.PenType, PenType.SolidColor);
1143 AssertEquals ("P73#2", pen.Color, Color.LightSkyBlue);
1146 pen.Color = Color.LightSkyBlue;
1147 Fail ("P73#3: must throw ArgumentException");
1148 } catch (ArgumentException) {
1149 Assert ("P73#3", true);
1154 public void TestLightSlateGray ()
1156 Pen pen = Pens.LightSlateGray;
1157 AssertEquals ("P74#1", pen.PenType, PenType.SolidColor);
1158 AssertEquals ("P74#2", pen.Color, Color.LightSlateGray);
1161 pen.Color = Color.LightSlateGray;
1162 Fail ("P74#3: must throw ArgumentException");
1163 } catch (ArgumentException) {
1164 Assert ("P74#3", true);
1169 public void TestLightSteelBlue ()
1171 Pen pen = Pens.LightSteelBlue;
1172 AssertEquals ("P75#1", pen.PenType, PenType.SolidColor);
1173 AssertEquals ("P75#2", pen.Color, Color.LightSteelBlue);
1176 pen.Color = Color.LightSteelBlue;
1177 Fail ("P75#3: must throw ArgumentException");
1178 } catch (ArgumentException) {
1179 Assert ("P75#3", true);
1184 public void TestLightYellow ()
1186 Pen pen = Pens.LightYellow;
1187 AssertEquals ("P76#1", pen.PenType, PenType.SolidColor);
1188 AssertEquals ("P76#2", pen.Color, Color.LightYellow);
1191 pen.Color = Color.LightYellow;
1192 Fail ("P76#3: must throw ArgumentException");
1193 } catch (ArgumentException) {
1194 Assert ("P76#3", true);
1199 public void TestLime ()
1201 Pen pen = Pens.Lime;
1202 AssertEquals ("P77#1", pen.PenType, PenType.SolidColor);
1203 AssertEquals ("P77#2", pen.Color, Color.Lime);
1206 pen.Color = Color.Lime;
1207 Fail ("P77#3: must throw ArgumentException");
1208 } catch (ArgumentException) {
1209 Assert ("P77#3", true);
1214 public void TestLimeGreen ()
1216 Pen pen = Pens.LimeGreen;
1217 AssertEquals ("P78#1", pen.PenType, PenType.SolidColor);
1218 AssertEquals ("P78#2", pen.Color, Color.LimeGreen);
1221 pen.Color = Color.LimeGreen;
1222 Fail ("P78#3: must throw ArgumentException");
1223 } catch (ArgumentException) {
1224 Assert ("P78#3", true);
1229 public void TestLinen ()
1231 Pen pen = Pens.Linen;
1232 AssertEquals ("P79#1", pen.PenType, PenType.SolidColor);
1233 AssertEquals ("P79#2", pen.Color, Color.Linen);
1236 pen.Color = Color.Linen;
1237 Fail ("P79#3: must throw ArgumentException");
1238 } catch (ArgumentException) {
1239 Assert ("P79#3", true);
1244 public void TestMagenta ()
1246 Pen pen = Pens.Magenta;
1247 AssertEquals ("P80#1", pen.PenType, PenType.SolidColor);
1248 AssertEquals ("P80#2", pen.Color, Color.Magenta);
1251 pen.Color = Color.Magenta;
1252 Fail ("P80#3: must throw ArgumentException");
1253 } catch (ArgumentException) {
1254 Assert ("P80#3", true);
1259 public void TestMaroon ()
1261 Pen pen = Pens.Maroon;
1262 AssertEquals ("P81#1", pen.PenType, PenType.SolidColor);
1263 AssertEquals ("P81#2", pen.Color, Color.Maroon);
1266 pen.Color = Color.Maroon;
1267 Fail ("P81#3: must throw ArgumentException");
1268 } catch (ArgumentException) {
1269 Assert ("P81#3", true);
1274 public void TestMediumAquamarine ()
1276 Pen pen = Pens.MediumAquamarine;
1277 AssertEquals ("P82#1", pen.PenType, PenType.SolidColor);
1278 AssertEquals ("P82#2", pen.Color, Color.MediumAquamarine);
1281 pen.Color = Color.MediumAquamarine;
1282 Fail ("P82#3: must throw ArgumentException");
1283 } catch (ArgumentException) {
1284 Assert ("P82#3", true);
1289 public void TestMediumBlue ()
1291 Pen pen = Pens.MediumBlue;
1292 AssertEquals ("P83#1", pen.PenType, PenType.SolidColor);
1293 AssertEquals ("P83#2", pen.Color, Color.MediumBlue);
1296 pen.Color = Color.MediumBlue;
1297 Fail ("P83#3: must throw ArgumentException");
1298 } catch (ArgumentException) {
1299 Assert ("P83#3", true);
1304 public void TestMediumOrchid ()
1306 Pen pen = Pens.MediumOrchid;
1307 AssertEquals ("P84#1", pen.PenType, PenType.SolidColor);
1308 AssertEquals ("P84#2", pen.Color, Color.MediumOrchid);
1311 pen.Color = Color.MediumOrchid;
1312 Fail ("P84#3: must throw ArgumentException");
1313 } catch (ArgumentException) {
1314 Assert ("P84#3", true);
1319 public void TestMediumPurple ()
1321 Pen pen = Pens.MediumPurple;
1322 AssertEquals ("P85#1", pen.PenType, PenType.SolidColor);
1323 AssertEquals ("P85#2", pen.Color, Color.MediumPurple);
1326 pen.Color = Color.MediumPurple;
1327 Fail ("P85#3: must throw ArgumentException");
1328 } catch (ArgumentException) {
1329 Assert ("P85#3", true);
1334 public void TestMediumSeaGreen ()
1336 Pen pen = Pens.MediumSeaGreen;
1337 AssertEquals ("P86#1", pen.PenType, PenType.SolidColor);
1338 AssertEquals ("P86#2", pen.Color, Color.MediumSeaGreen);
1341 pen.Color = Color.MediumSeaGreen;
1342 Fail ("P86#3: must throw ArgumentException");
1343 } catch (ArgumentException) {
1344 Assert ("P86#3", true);
1349 public void TestMediumSlateBlue ()
1351 Pen pen = Pens.MediumSlateBlue;
1352 AssertEquals ("P87#1", pen.PenType, PenType.SolidColor);
1353 AssertEquals ("P87#2", pen.Color, Color.MediumSlateBlue);
1356 pen.Color = Color.MediumSlateBlue;
1357 Fail ("P87#3: must throw ArgumentException");
1358 } catch (ArgumentException) {
1359 Assert ("P87#3", true);
1364 public void TestMediumSpringGreen ()
1366 Pen pen = Pens.MediumSpringGreen;
1367 AssertEquals ("P88#1", pen.PenType, PenType.SolidColor);
1368 AssertEquals ("P88#2", pen.Color, Color.MediumSpringGreen);
1371 pen.Color = Color.MediumSpringGreen;
1372 Fail ("P88#3: must throw ArgumentException");
1373 } catch (ArgumentException) {
1374 Assert ("P88#3", true);
1379 public void TestMediumTurquoise ()
1381 Pen pen = Pens.MediumTurquoise;
1382 AssertEquals ("P89#1", pen.PenType, PenType.SolidColor);
1383 AssertEquals ("P89#2", pen.Color, Color.MediumTurquoise);
1386 pen.Color = Color.MediumTurquoise;
1387 Fail ("P89#3: must throw ArgumentException");
1388 } catch (ArgumentException) {
1389 Assert ("P89#3", true);
1394 public void TestMediumVioletRed ()
1396 Pen pen = Pens.MediumVioletRed;
1397 AssertEquals ("P90#1", pen.PenType, PenType.SolidColor);
1398 AssertEquals ("P90#2", pen.Color, Color.MediumVioletRed);
1401 pen.Color = Color.MediumVioletRed;
1402 Fail ("P90#3: must throw ArgumentException");
1403 } catch (ArgumentException) {
1404 Assert ("P90#3", true);
1409 public void TestMidnightBlue ()
1411 Pen pen = Pens.MidnightBlue;
1412 AssertEquals ("P91#1", pen.PenType, PenType.SolidColor);
1413 AssertEquals ("P91#2", pen.Color, Color.MidnightBlue);
1416 pen.Color = Color.MidnightBlue;
1417 Fail ("P91#3: must throw ArgumentException");
1418 } catch (ArgumentException) {
1419 Assert ("P91#3", true);
1424 public void TestMintCream ()
1426 Pen pen = Pens.MintCream;
1427 AssertEquals ("P92#1", pen.PenType, PenType.SolidColor);
1428 AssertEquals ("P92#2", pen.Color, Color.MintCream);
1431 pen.Color = Color.MintCream;
1432 Fail ("P92#3: must throw ArgumentException");
1433 } catch (ArgumentException) {
1434 Assert ("P92#3", true);
1439 public void TestMistyRose ()
1441 Pen pen = Pens.MistyRose;
1442 AssertEquals ("P93#1", pen.PenType, PenType.SolidColor);
1443 AssertEquals ("P93#2", pen.Color, Color.MistyRose);
1446 pen.Color = Color.MistyRose;
1447 Fail ("P93#3: must throw ArgumentException");
1448 } catch (ArgumentException) {
1449 Assert ("P93#3", true);
1454 public void TestMoccasin ()
1456 Pen pen = Pens.Moccasin;
1457 AssertEquals ("P94#1", pen.PenType, PenType.SolidColor);
1458 AssertEquals ("P94#2", pen.Color, Color.Moccasin);
1461 pen.Color = Color.Moccasin;
1462 Fail ("P94#3: must throw ArgumentException");
1463 } catch (ArgumentException) {
1464 Assert ("P94#3", true);
1469 public void TestNavajoWhite ()
1471 Pen pen = Pens.NavajoWhite;
1472 AssertEquals ("P95#1", pen.PenType, PenType.SolidColor);
1473 AssertEquals ("P95#2", pen.Color, Color.NavajoWhite);
1476 pen.Color = Color.NavajoWhite;
1477 Fail ("P95#3: must throw ArgumentException");
1478 } catch (ArgumentException) {
1479 Assert ("P95#3", true);
1484 public void TestNavy ()
1486 Pen pen = Pens.Navy;
1487 AssertEquals ("P96#1", pen.PenType, PenType.SolidColor);
1488 AssertEquals ("P96#2", pen.Color, Color.Navy);
1491 pen.Color = Color.Navy;
1492 Fail ("P96#3: must throw ArgumentException");
1493 } catch (ArgumentException) {
1494 Assert ("P96#3", true);
1499 public void TestOldLace ()
1501 Pen pen = Pens.OldLace;
1502 AssertEquals ("P97#1", pen.PenType, PenType.SolidColor);
1503 AssertEquals ("P97#2", pen.Color, Color.OldLace);
1506 pen.Color = Color.OldLace;
1507 Fail ("P97#3: must throw ArgumentException");
1508 } catch (ArgumentException) {
1509 Assert ("P97#3", true);
1514 public void TestOlive ()
1516 Pen pen = Pens.Olive;
1517 AssertEquals ("P98#1", pen.PenType, PenType.SolidColor);
1518 AssertEquals ("P98#2", pen.Color, Color.Olive);
1521 pen.Color = Color.Olive;
1522 Fail ("P98#3: must throw ArgumentException");
1523 } catch (ArgumentException) {
1524 Assert ("P98#3", true);
1529 public void TestOliveDrab ()
1531 Pen pen = Pens.OliveDrab;
1532 AssertEquals ("P99#1", pen.PenType, PenType.SolidColor);
1533 AssertEquals ("P99#2", pen.Color, Color.OliveDrab);
1536 pen.Color = Color.OliveDrab;
1537 Fail ("P99#3: must throw ArgumentException");
1538 } catch (ArgumentException) {
1539 Assert ("P99#3", true);
1544 public void TestOrange ()
1546 Pen pen = Pens.Orange;
1547 AssertEquals ("P100#1", pen.PenType, PenType.SolidColor);
1548 AssertEquals ("P100#2", pen.Color, Color.Orange);
1551 pen.Color = Color.Orange;
1552 Fail ("P100#3: must throw ArgumentException");
1553 } catch (ArgumentException) {
1554 Assert ("P100#3", true);
1559 public void TestOrangeRed ()
1561 Pen pen = Pens.OrangeRed;
1562 AssertEquals ("P101#1", pen.PenType, PenType.SolidColor);
1563 AssertEquals ("P101#2", pen.Color, Color.OrangeRed);
1566 pen.Color = Color.OrangeRed;
1567 Fail ("P101#3: must throw ArgumentException");
1568 } catch (ArgumentException) {
1569 Assert ("P101#3", true);
1574 public void TestOrchid ()
1576 Pen pen = Pens.Orchid;
1577 AssertEquals ("P102#1", pen.PenType, PenType.SolidColor);
1578 AssertEquals ("P102#2", pen.Color, Color.Orchid);
1581 pen.Color = Color.Orchid;
1582 Fail ("P102#3: must throw ArgumentException");
1583 } catch (ArgumentException) {
1584 Assert ("P102#3", true);
1589 public void TestPaleGoldenrod ()
1591 Pen pen = Pens.PaleGoldenrod;
1592 AssertEquals ("P103#1", pen.PenType, PenType.SolidColor);
1593 AssertEquals ("P103#2", pen.Color, Color.PaleGoldenrod);
1596 pen.Color = Color.PaleGoldenrod;
1597 Fail ("P103#3: must throw ArgumentException");
1598 } catch (ArgumentException) {
1599 Assert ("P103#3", true);
1604 public void TestPaleGreen ()
1606 Pen pen = Pens.PaleGreen;
1607 AssertEquals ("P104#1", pen.PenType, PenType.SolidColor);
1608 AssertEquals ("P104#2", pen.Color, Color.PaleGreen);
1611 pen.Color = Color.PaleGreen;
1612 Fail ("P104#3: must throw ArgumentException");
1613 } catch (ArgumentException) {
1614 Assert ("P104#3", true);
1619 public void TestPaleTurquoise ()
1621 Pen pen = Pens.PaleTurquoise;
1622 AssertEquals ("P105#1", pen.PenType, PenType.SolidColor);
1623 AssertEquals ("P105#2", pen.Color, Color.PaleTurquoise);
1626 pen.Color = Color.PaleTurquoise;
1627 Fail ("P105#3: must throw ArgumentException");
1628 } catch (ArgumentException) {
1629 Assert ("P105#3", true);
1634 public void TestPaleVioletRed ()
1636 Pen pen = Pens.PaleVioletRed;
1637 AssertEquals ("P106#1", pen.PenType, PenType.SolidColor);
1638 AssertEquals ("P106#2", pen.Color, Color.PaleVioletRed);
1641 pen.Color = Color.PaleVioletRed;
1642 Fail ("P106#3: must throw ArgumentException");
1643 } catch (ArgumentException) {
1644 Assert ("P106#3", true);
1649 public void TestPapayaWhip ()
1651 Pen pen = Pens.PapayaWhip;
1652 AssertEquals ("P107#1", pen.PenType, PenType.SolidColor);
1653 AssertEquals ("P107#2", pen.Color, Color.PapayaWhip);
1656 pen.Color = Color.PapayaWhip;
1657 Fail ("P107#3: must throw ArgumentException");
1658 } catch (ArgumentException) {
1659 Assert ("P107#3", true);
1664 public void TestPeachPuff ()
1666 Pen pen = Pens.PeachPuff;
1667 AssertEquals ("P108#1", pen.PenType, PenType.SolidColor);
1668 AssertEquals ("P108#2", pen.Color, Color.PeachPuff);
1671 pen.Color = Color.PeachPuff;
1672 Fail ("P108#3: must throw ArgumentException");
1673 } catch (ArgumentException) {
1674 Assert ("P108#3", true);
1679 public void TestPeru ()
1681 Pen pen = Pens.Peru;
1682 AssertEquals ("P109#1", pen.PenType, PenType.SolidColor);
1683 AssertEquals ("P109#2", pen.Color, Color.Peru);
1686 pen.Color = Color.Peru;
1687 Fail ("P109#3: must throw ArgumentException");
1688 } catch (ArgumentException) {
1689 Assert ("P109#3", true);
1694 public void TestPink ()
1696 Pen pen = Pens.Pink;
1697 AssertEquals ("P110#1", pen.PenType, PenType.SolidColor);
1698 AssertEquals ("P110#2", pen.Color, Color.Pink);
1701 pen.Color = Color.Pink;
1702 Fail ("P110#3: must throw ArgumentException");
1703 } catch (ArgumentException) {
1704 Assert ("P110#3", true);
1709 public void TestPlum ()
1711 Pen pen = Pens.Plum;
1712 AssertEquals ("P111#1", pen.PenType, PenType.SolidColor);
1713 AssertEquals ("P111#2", pen.Color, Color.Plum);
1716 pen.Color = Color.Plum;
1717 Fail ("P111#3: must throw ArgumentException");
1718 } catch (ArgumentException) {
1719 Assert ("P111#3", true);
1724 public void TestPowderBlue ()
1726 Pen pen = Pens.PowderBlue;
1727 AssertEquals ("P112#1", pen.PenType, PenType.SolidColor);
1728 AssertEquals ("P112#2", pen.Color, Color.PowderBlue);
1731 pen.Color = Color.PowderBlue;
1732 Fail ("P112#3: must throw ArgumentException");
1733 } catch (ArgumentException) {
1734 Assert ("P112#3", true);
1739 public void TestPurple ()
1741 Pen pen = Pens.Purple;
1742 AssertEquals ("P113#1", pen.PenType, PenType.SolidColor);
1743 AssertEquals ("P113#2", pen.Color, Color.Purple);
1746 pen.Color = Color.Purple;
1747 Fail ("P113#3: must throw ArgumentException");
1748 } catch (ArgumentException) {
1749 Assert ("P113#3", true);
1754 public void TestRed ()
1757 AssertEquals ("P114#1", pen.PenType, PenType.SolidColor);
1758 AssertEquals ("P114#2", pen.Color, Color.Red);
1761 pen.Color = Color.Red;
1762 Fail ("P114#3: must throw ArgumentException");
1763 } catch (ArgumentException) {
1764 Assert ("P114#3", true);
1769 public void TestRosyBrown ()
1771 Pen pen = Pens.RosyBrown;
1772 AssertEquals ("P115#1", pen.PenType, PenType.SolidColor);
1773 AssertEquals ("P115#2", pen.Color, Color.RosyBrown);
1776 pen.Color = Color.RosyBrown;
1777 Fail ("P115#3: must throw ArgumentException");
1778 } catch (ArgumentException) {
1779 Assert ("P115#3", true);
1784 public void TestRoyalBlue ()
1786 Pen pen = Pens.RoyalBlue;
1787 AssertEquals ("P116#1", pen.PenType, PenType.SolidColor);
1788 AssertEquals ("P116#2", pen.Color, Color.RoyalBlue);
1791 pen.Color = Color.RoyalBlue;
1792 Fail ("P116#3: must throw ArgumentException");
1793 } catch (ArgumentException) {
1794 Assert ("P116#3", true);
1799 public void TestSaddleBrown ()
1801 Pen pen = Pens.SaddleBrown;
1802 AssertEquals ("P117#1", pen.PenType, PenType.SolidColor);
1803 AssertEquals ("P117#2", pen.Color, Color.SaddleBrown);
1806 pen.Color = Color.SaddleBrown;
1807 Fail ("P117#3: must throw ArgumentException");
1808 } catch (ArgumentException) {
1809 Assert ("P117#3", true);
1814 public void TestSalmon ()
1816 Pen pen = Pens.Salmon;
1817 AssertEquals ("P118#1", pen.PenType, PenType.SolidColor);
1818 AssertEquals ("P118#2", pen.Color, Color.Salmon);
1821 pen.Color = Color.Salmon;
1822 Fail ("P118#3: must throw ArgumentException");
1823 } catch (ArgumentException) {
1824 Assert ("P118#3", true);
1829 public void TestSandyBrown ()
1831 Pen pen = Pens.SandyBrown;
1832 AssertEquals ("P119#1", pen.PenType, PenType.SolidColor);
1833 AssertEquals ("P119#2", pen.Color, Color.SandyBrown);
1836 pen.Color = Color.SandyBrown;
1837 Fail ("P119#3: must throw ArgumentException");
1838 } catch (ArgumentException) {
1839 Assert ("P119#3", true);
1844 public void TestSeaGreen ()
1846 Pen pen = Pens.SeaGreen;
1847 AssertEquals ("P120#1", pen.PenType, PenType.SolidColor);
1848 AssertEquals ("P120#2", pen.Color, Color.SeaGreen);
1851 pen.Color = Color.SeaGreen;
1852 Fail ("P120#3: must throw ArgumentException");
1853 } catch (ArgumentException) {
1854 Assert ("P120#3", true);
1859 public void TestSeaShell ()
1861 Pen pen = Pens.SeaShell;
1862 AssertEquals ("P121#1", pen.PenType, PenType.SolidColor);
1863 AssertEquals ("P121#2", pen.Color, Color.SeaShell);
1866 pen.Color = Color.SeaShell;
1867 Fail ("P121#3: must throw ArgumentException");
1868 } catch (ArgumentException) {
1869 Assert ("P121#3", true);
1874 public void TestSienna ()
1876 Pen pen = Pens.Sienna;
1877 AssertEquals ("P122#1", pen.PenType, PenType.SolidColor);
1878 AssertEquals ("P122#2", pen.Color, Color.Sienna);
1881 pen.Color = Color.Sienna;
1882 Fail ("P122#3: must throw ArgumentException");
1883 } catch (ArgumentException) {
1884 Assert ("P122#3", true);
1889 public void TestSilver ()
1891 Pen pen = Pens.Silver;
1892 AssertEquals ("P123#1", pen.PenType, PenType.SolidColor);
1893 AssertEquals ("P123#2", pen.Color, Color.Silver);
1896 pen.Color = Color.Silver;
1897 Fail ("P123#3: must throw ArgumentException");
1898 } catch (ArgumentException) {
1899 Assert ("P123#3", true);
1904 public void TestSkyBlue ()
1906 Pen pen = Pens.SkyBlue;
1907 AssertEquals ("P124#1", pen.PenType, PenType.SolidColor);
1908 AssertEquals ("P124#2", pen.Color, Color.SkyBlue);
1911 pen.Color = Color.SkyBlue;
1912 Fail ("P124#3: must throw ArgumentException");
1913 } catch (ArgumentException) {
1914 Assert ("P124#3", true);
1919 public void TestSlateBlue ()
1921 Pen pen = Pens.SlateBlue;
1922 AssertEquals ("P125#1", pen.PenType, PenType.SolidColor);
1923 AssertEquals ("P125#2", pen.Color, Color.SlateBlue);
1926 pen.Color = Color.SlateBlue;
1927 Fail ("P125#3: must throw ArgumentException");
1928 } catch (ArgumentException) {
1929 Assert ("P125#3", true);
1934 public void TestSlateGray ()
1936 Pen pen = Pens.SlateGray;
1937 AssertEquals ("P126#1", pen.PenType, PenType.SolidColor);
1938 AssertEquals ("P126#2", pen.Color, Color.SlateGray);
1941 pen.Color = Color.SlateGray;
1942 Fail ("P126#3: must throw ArgumentException");
1943 } catch (ArgumentException) {
1944 Assert ("P126#3", true);
1949 public void TestSnow ()
1951 Pen pen = Pens.Snow;
1952 AssertEquals ("P127#1", pen.PenType, PenType.SolidColor);
1953 AssertEquals ("P127#2", pen.Color, Color.Snow);
1956 pen.Color = Color.Snow;
1957 Fail ("P127#3: must throw ArgumentException");
1958 } catch (ArgumentException) {
1959 Assert ("P127#3", true);
1964 public void TestSpringGreen ()
1966 Pen pen = Pens.SpringGreen;
1967 AssertEquals ("P128#1", pen.PenType, PenType.SolidColor);
1968 AssertEquals ("P128#2", pen.Color, Color.SpringGreen);
1971 pen.Color = Color.SpringGreen;
1972 Fail ("P128#3: must throw ArgumentException");
1973 } catch (ArgumentException) {
1974 Assert ("P128#3", true);
1979 public void TestSteelBlue ()
1981 Pen pen = Pens.SteelBlue;
1982 AssertEquals ("P129#1", pen.PenType, PenType.SolidColor);
1983 AssertEquals ("P129#2", pen.Color, Color.SteelBlue);
1986 pen.Color = Color.SteelBlue;
1987 Fail ("P129#3: must throw ArgumentException");
1988 } catch (ArgumentException) {
1989 Assert ("P129#3", true);
1994 public void TestTan ()
1997 AssertEquals ("P130#1", pen.PenType, PenType.SolidColor);
1998 AssertEquals ("P130#2", pen.Color, Color.Tan);
2001 pen.Color = Color.Tan;
2002 Fail ("P130#3: must throw ArgumentException");
2003 } catch (ArgumentException) {
2004 Assert ("P130#3", true);
2009 public void TestTeal ()
2011 Pen pen = Pens.Teal;
2012 AssertEquals ("P131#1", pen.PenType, PenType.SolidColor);
2013 AssertEquals ("P131#2", pen.Color, Color.Teal);
2016 pen.Color = Color.Teal;
2017 Fail ("P131#3: must throw ArgumentException");
2018 } catch (ArgumentException) {
2019 Assert ("P131#3", true);
2024 public void TestThistle ()
2026 Pen pen = Pens.Thistle;
2027 AssertEquals ("P132#1", pen.PenType, PenType.SolidColor);
2028 AssertEquals ("P132#2", pen.Color, Color.Thistle);
2031 pen.Color = Color.Thistle;
2032 Fail ("P132#3: must throw ArgumentException");
2033 } catch (ArgumentException) {
2034 Assert ("P132#3", true);
2039 public void TestTomato ()
2041 Pen pen = Pens.Tomato;
2042 AssertEquals ("P133#1", pen.PenType, PenType.SolidColor);
2043 AssertEquals ("P133#2", pen.Color, Color.Tomato);
2046 pen.Color = Color.Tomato;
2047 Fail ("P133#3: must throw ArgumentException");
2048 } catch (ArgumentException) {
2049 Assert ("P133#3", true);
2054 public void TestTransparent ()
2056 Pen pen = Pens.Transparent;
2057 AssertEquals ("P134#1", pen.PenType, PenType.SolidColor);
2058 AssertEquals ("P134#2", pen.Color, Color.Transparent);
2061 pen.Color = Color.Transparent;
2062 Fail ("P134#3: must throw ArgumentException");
2063 } catch (ArgumentException) {
2064 Assert ("P134#3", true);
2069 public void TestTurquoise ()
2071 Pen pen = Pens.Turquoise;
2072 AssertEquals ("P135#1", pen.PenType, PenType.SolidColor);
2073 AssertEquals ("P135#2", pen.Color, Color.Turquoise);
2076 pen.Color = Color.Turquoise;
2077 Fail ("P135#3: must throw ArgumentException");
2078 } catch (ArgumentException) {
2079 Assert ("P135#3", true);
2084 public void TestViolet ()
2086 Pen pen = Pens.Violet;
2087 AssertEquals ("P136#1", pen.PenType, PenType.SolidColor);
2088 AssertEquals ("P136#2", pen.Color, Color.Violet);
2091 pen.Color = Color.Violet;
2092 Fail ("P136#3: must throw ArgumentException");
2093 } catch (ArgumentException) {
2094 Assert ("P136#3", true);
2099 public void TestWheat ()
2101 Pen pen = Pens.Wheat;
2102 AssertEquals ("P137#1", pen.PenType, PenType.SolidColor);
2103 AssertEquals ("P137#2", pen.Color, Color.Wheat);
2106 pen.Color = Color.Wheat;
2107 Fail ("P137#3: must throw ArgumentException");
2108 } catch (ArgumentException) {
2109 Assert ("P137#3", true);
2114 public void TestWhite ()
2116 Pen pen = Pens.White;
2117 AssertEquals ("P138#1", pen.PenType, PenType.SolidColor);
2118 AssertEquals ("P138#2", pen.Color, Color.White);
2121 pen.Color = Color.White;
2122 Fail ("P138#3: must throw ArgumentException");
2123 } catch (ArgumentException) {
2124 Assert ("P138#3", true);
2129 public void TestWhiteSmoke ()
2131 Pen pen = Pens.WhiteSmoke;
2132 AssertEquals ("P139#1", pen.PenType, PenType.SolidColor);
2133 AssertEquals ("P139#2", pen.Color, Color.WhiteSmoke);
2136 pen.Color = Color.WhiteSmoke;
2137 Fail ("P139#3: must throw ArgumentException");
2138 } catch (ArgumentException) {
2139 Assert ("P139#3", true);
2144 public void TestYellow ()
2146 Pen pen = Pens.Yellow;
2147 AssertEquals ("P140#1", pen.PenType, PenType.SolidColor);
2148 AssertEquals ("P140#2", pen.Color, Color.Yellow);
2151 pen.Color = Color.Yellow;
2152 Fail ("P140#3: must throw ArgumentException");
2153 } catch (ArgumentException) {
2154 Assert ("P140#3", true);
2159 public void TestYellowGreen ()
2161 Pen pen = Pens.YellowGreen;
2162 AssertEquals ("P141#1", pen.PenType, PenType.SolidColor);
2163 AssertEquals ("P141#2", pen.Color, Color.YellowGreen);
2166 pen.Color = Color.YellowGreen;
2167 Fail ("P141#3: must throw ArgumentException");
2168 } catch (ArgumentException) {
2169 Assert ("P141#3", true);
2175 // Following code was used to generate the test methods above
2177 //Type type = typeof (Pens);
2178 //PropertyInfo [] properties = type.GetProperties ();
2180 //foreach (PropertyInfo property in properties) {
2181 // Console.WriteLine();
2182 // Console.WriteLine("\t\t[Test]");
2183 // Console.WriteLine("\t\tpublic void Test" + property.Name + " ()");
2184 // Console.WriteLine("\t\t{");
2185 // Console.WriteLine("\t\t\tPen pen = Pens." + property.Name + ";");
2186 // Console.WriteLine("\t\t\tAssertEquals (\"P" + count + "#1\", pen.PenType, PenType.SolidColor);");
2187 // Console.WriteLine("\t\t\tAssertEquals (\"P" + count + "#2\", pen.Color, Color." + property.Name + ");\n");
2189 // Console.WriteLine("\t\t\ttry {");
2190 // Console.WriteLine("\t\t\t\tpen.Color = Color." + property.Name + ";");
2191 // Console.WriteLine("\t\t\t\tFail (\"P" + count + "#3: must throw ArgumentException\");");
2192 // Console.WriteLine("\t\t\t} catch (ArgumentException) {");
2193 // Console.WriteLine("\t\t\t\tAssert (\"P" + count + "#3\", true);");
2194 // Console.WriteLine("\t\t\t}");
2195 // Console.WriteLine("\t\t}");