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;
36 namespace MonoTests.System.Drawing
39 public class PensTest : Assertion
42 public void SetUp () { }
45 public void TearDown () { }
48 public void TestEquals ()
53 AssertEquals ("Equals", true, pen1.Equals (pen2));
57 public void TestAliceBlue ()
59 Pen pen = Pens.AliceBlue;
60 AssertEquals ("P1#1", pen.PenType, PenType.SolidColor);
61 AssertEquals ("P1#2", pen.Color, Color.AliceBlue);
64 pen.Color = Color.AliceBlue;
65 Fail ("P1#3: must throw ArgumentException");
66 } catch (ArgumentException) {
67 Assert ("P1#3", true);
72 public void TestAntiqueWhite ()
74 Pen pen = Pens.AntiqueWhite;
75 AssertEquals ("P2#1", pen.PenType, PenType.SolidColor);
76 AssertEquals ("P2#2", pen.Color, Color.AntiqueWhite);
79 pen.Color = Color.AntiqueWhite;
80 Fail ("P2#3: must throw ArgumentException");
81 } catch (ArgumentException) {
82 Assert ("P2#3", true);
87 public void TestAqua ()
90 AssertEquals ("P3#1", pen.PenType, PenType.SolidColor);
91 AssertEquals ("P3#2", pen.Color, Color.Aqua);
94 pen.Color = Color.Aqua;
95 Fail ("P3#3: must throw ArgumentException");
96 } catch (ArgumentException) {
97 Assert ("P3#3", true);
102 public void TestAquamarine ()
104 Pen pen = Pens.Aquamarine;
105 AssertEquals ("P4#1", pen.PenType, PenType.SolidColor);
106 AssertEquals ("P4#2", pen.Color, Color.Aquamarine);
109 pen.Color = Color.Aquamarine;
110 Fail ("P4#3: must throw ArgumentException");
111 } catch (ArgumentException) {
112 Assert ("P4#3", true);
117 public void TestAzure ()
119 Pen pen = Pens.Azure;
120 AssertEquals ("P5#1", pen.PenType, PenType.SolidColor);
121 AssertEquals ("P5#2", pen.Color, Color.Azure);
124 pen.Color = Color.Azure;
125 Fail ("P5#3: must throw ArgumentException");
126 } catch (ArgumentException) {
127 Assert ("P5#3", true);
132 public void TestBeige ()
134 Pen pen = Pens.Beige;
135 AssertEquals ("P6#1", pen.PenType, PenType.SolidColor);
136 AssertEquals ("P6#2", pen.Color, Color.Beige);
139 pen.Color = Color.Beige;
140 Fail ("P6#3: must throw ArgumentException");
141 } catch (ArgumentException) {
142 Assert ("P6#3", true);
147 public void TestBisque ()
149 Pen pen = Pens.Bisque;
150 AssertEquals ("P7#1", pen.PenType, PenType.SolidColor);
151 AssertEquals ("P7#2", pen.Color, Color.Bisque);
154 pen.Color = Color.Bisque;
155 Fail ("P7#3: must throw ArgumentException");
156 } catch (ArgumentException) {
157 Assert ("P7#3", true);
162 public void TestBlack ()
164 Pen pen = Pens.Black;
165 AssertEquals ("P8#1", pen.PenType, PenType.SolidColor);
166 AssertEquals ("P8#2", pen.Color, Color.Black);
169 pen.Color = Color.Black;
170 Fail ("P8#3: must throw ArgumentException");
171 } catch (ArgumentException) {
172 Assert ("P8#3", true);
177 public void TestBlanchedAlmond ()
179 Pen pen = Pens.BlanchedAlmond;
180 AssertEquals ("P9#1", pen.PenType, PenType.SolidColor);
181 AssertEquals ("P9#2", pen.Color, Color.BlanchedAlmond);
184 pen.Color = Color.BlanchedAlmond;
185 Fail ("P9#3: must throw ArgumentException");
186 } catch (ArgumentException) {
187 Assert ("P9#3", true);
192 public void TestBlue ()
195 AssertEquals ("P10#1", pen.PenType, PenType.SolidColor);
196 AssertEquals ("P10#2", pen.Color, Color.Blue);
199 pen.Color = Color.Blue;
200 Fail ("P10#3: must throw ArgumentException");
201 } catch (ArgumentException) {
202 Assert ("P10#3", true);
207 public void TestBlueViolet ()
209 Pen pen = Pens.BlueViolet;
210 AssertEquals ("P11#1", pen.PenType, PenType.SolidColor);
211 AssertEquals ("P11#2", pen.Color, Color.BlueViolet);
214 pen.Color = Color.BlueViolet;
215 Fail ("P11#3: must throw ArgumentException");
216 } catch (ArgumentException) {
217 Assert ("P11#3", true);
222 public void TestBrown ()
224 Pen pen = Pens.Brown;
225 AssertEquals ("P12#1", pen.PenType, PenType.SolidColor);
226 AssertEquals ("P12#2", pen.Color, Color.Brown);
229 pen.Color = Color.Brown;
230 Fail ("P12#3: must throw ArgumentException");
231 } catch (ArgumentException) {
232 Assert ("P12#3", true);
237 public void TestBurlyWood ()
239 Pen pen = Pens.BurlyWood;
240 AssertEquals ("P13#1", pen.PenType, PenType.SolidColor);
241 AssertEquals ("P13#2", pen.Color, Color.BurlyWood);
244 pen.Color = Color.BurlyWood;
245 Fail ("P13#3: must throw ArgumentException");
246 } catch (ArgumentException) {
247 Assert ("P13#3", true);
252 public void TestCadetBlue ()
254 Pen pen = Pens.CadetBlue;
255 AssertEquals ("P14#1", pen.PenType, PenType.SolidColor);
256 AssertEquals ("P14#2", pen.Color, Color.CadetBlue);
259 pen.Color = Color.CadetBlue;
260 Fail ("P14#3: must throw ArgumentException");
261 } catch (ArgumentException) {
262 Assert ("P14#3", true);
267 public void TestChartreuse ()
269 Pen pen = Pens.Chartreuse;
270 AssertEquals ("P15#1", pen.PenType, PenType.SolidColor);
271 AssertEquals ("P15#2", pen.Color, Color.Chartreuse);
274 pen.Color = Color.Chartreuse;
275 Fail ("P15#3: must throw ArgumentException");
276 } catch (ArgumentException) {
277 Assert ("P15#3", true);
282 public void TestChocolate ()
284 Pen pen = Pens.Chocolate;
285 AssertEquals ("P16#1", pen.PenType, PenType.SolidColor);
286 AssertEquals ("P16#2", pen.Color, Color.Chocolate);
289 pen.Color = Color.Chocolate;
290 Fail ("P16#3: must throw ArgumentException");
291 } catch (ArgumentException) {
292 Assert ("P16#3", true);
297 public void TestCoral ()
299 Pen pen = Pens.Coral;
300 AssertEquals ("P17#1", pen.PenType, PenType.SolidColor);
301 AssertEquals ("P17#2", pen.Color, Color.Coral);
304 pen.Color = Color.Coral;
305 Fail ("P17#3: must throw ArgumentException");
306 } catch (ArgumentException) {
307 Assert ("P17#3", true);
312 public void TestCornflowerBlue ()
314 Pen pen = Pens.CornflowerBlue;
315 AssertEquals ("P18#1", pen.PenType, PenType.SolidColor);
316 AssertEquals ("P18#2", pen.Color, Color.CornflowerBlue);
319 pen.Color = Color.CornflowerBlue;
320 Fail ("P18#3: must throw ArgumentException");
321 } catch (ArgumentException) {
322 Assert ("P18#3", true);
327 public void TestCornsilk ()
329 Pen pen = Pens.Cornsilk;
330 AssertEquals ("P19#1", pen.PenType, PenType.SolidColor);
331 AssertEquals ("P19#2", pen.Color, Color.Cornsilk);
334 pen.Color = Color.Cornsilk;
335 Fail ("P19#3: must throw ArgumentException");
336 } catch (ArgumentException) {
337 Assert ("P19#3", true);
342 public void TestCrimson ()
344 Pen pen = Pens.Crimson;
345 AssertEquals ("P20#1", pen.PenType, PenType.SolidColor);
346 AssertEquals ("P20#2", pen.Color, Color.Crimson);
349 pen.Color = Color.Crimson;
350 Fail ("P20#3: must throw ArgumentException");
351 } catch (ArgumentException) {
352 Assert ("P20#3", true);
357 public void TestCyan ()
360 AssertEquals ("P21#1", pen.PenType, PenType.SolidColor);
361 AssertEquals ("P21#2", pen.Color, Color.Cyan);
364 pen.Color = Color.Cyan;
365 Fail ("P21#3: must throw ArgumentException");
366 } catch (ArgumentException) {
367 Assert ("P21#3", true);
372 public void TestDarkBlue ()
374 Pen pen = Pens.DarkBlue;
375 AssertEquals ("P22#1", pen.PenType, PenType.SolidColor);
376 AssertEquals ("P22#2", pen.Color, Color.DarkBlue);
379 pen.Color = Color.DarkBlue;
380 Fail ("P22#3: must throw ArgumentException");
381 } catch (ArgumentException) {
382 Assert ("P22#3", true);
387 public void TestDarkCyan ()
389 Pen pen = Pens.DarkCyan;
390 AssertEquals ("P23#1", pen.PenType, PenType.SolidColor);
391 AssertEquals ("P23#2", pen.Color, Color.DarkCyan);
394 pen.Color = Color.DarkCyan;
395 Fail ("P23#3: must throw ArgumentException");
396 } catch (ArgumentException) {
397 Assert ("P23#3", true);
402 public void TestDarkGoldenrod ()
404 Pen pen = Pens.DarkGoldenrod;
405 AssertEquals ("P24#1", pen.PenType, PenType.SolidColor);
406 AssertEquals ("P24#2", pen.Color, Color.DarkGoldenrod);
409 pen.Color = Color.DarkGoldenrod;
410 Fail ("P24#3: must throw ArgumentException");
411 } catch (ArgumentException) {
412 Assert ("P24#3", true);
417 public void TestDarkGray ()
419 Pen pen = Pens.DarkGray;
420 AssertEquals ("P25#1", pen.PenType, PenType.SolidColor);
421 AssertEquals ("P25#2", pen.Color, Color.DarkGray);
424 pen.Color = Color.DarkGray;
425 Fail ("P25#3: must throw ArgumentException");
426 } catch (ArgumentException) {
427 Assert ("P25#3", true);
432 public void TestDarkGreen ()
434 Pen pen = Pens.DarkGreen;
435 AssertEquals ("P26#1", pen.PenType, PenType.SolidColor);
436 AssertEquals ("P26#2", pen.Color, Color.DarkGreen);
439 pen.Color = Color.DarkGreen;
440 Fail ("P26#3: must throw ArgumentException");
441 } catch (ArgumentException) {
442 Assert ("P26#3", true);
447 public void TestDarkKhaki ()
449 Pen pen = Pens.DarkKhaki;
450 AssertEquals ("P27#1", pen.PenType, PenType.SolidColor);
451 AssertEquals ("P27#2", pen.Color, Color.DarkKhaki);
454 pen.Color = Color.DarkKhaki;
455 Fail ("P27#3: must throw ArgumentException");
456 } catch (ArgumentException) {
457 Assert ("P27#3", true);
462 public void TestDarkMagenta ()
464 Pen pen = Pens.DarkMagenta;
465 AssertEquals ("P28#1", pen.PenType, PenType.SolidColor);
466 AssertEquals ("P28#2", pen.Color, Color.DarkMagenta);
469 pen.Color = Color.DarkMagenta;
470 Fail ("P28#3: must throw ArgumentException");
471 } catch (ArgumentException) {
472 Assert ("P28#3", true);
477 public void TestDarkOliveGreen ()
479 Pen pen = Pens.DarkOliveGreen;
480 AssertEquals ("P29#1", pen.PenType, PenType.SolidColor);
481 AssertEquals ("P29#2", pen.Color, Color.DarkOliveGreen);
484 pen.Color = Color.DarkOliveGreen;
485 Fail ("P29#3: must throw ArgumentException");
486 } catch (ArgumentException) {
487 Assert ("P29#3", true);
492 public void TestDarkOrange ()
494 Pen pen = Pens.DarkOrange;
495 AssertEquals ("P30#1", pen.PenType, PenType.SolidColor);
496 AssertEquals ("P30#2", pen.Color, Color.DarkOrange);
499 pen.Color = Color.DarkOrange;
500 Fail ("P30#3: must throw ArgumentException");
501 } catch (ArgumentException) {
502 Assert ("P30#3", true);
507 public void TestDarkOrchid ()
509 Pen pen = Pens.DarkOrchid;
510 AssertEquals ("P31#1", pen.PenType, PenType.SolidColor);
511 AssertEquals ("P31#2", pen.Color, Color.DarkOrchid);
514 pen.Color = Color.DarkOrchid;
515 Fail ("P31#3: must throw ArgumentException");
516 } catch (ArgumentException) {
517 Assert ("P31#3", true);
522 public void TestDarkRed ()
524 Pen pen = Pens.DarkRed;
525 AssertEquals ("P32#1", pen.PenType, PenType.SolidColor);
526 AssertEquals ("P32#2", pen.Color, Color.DarkRed);
529 pen.Color = Color.DarkRed;
530 Fail ("P32#3: must throw ArgumentException");
531 } catch (ArgumentException) {
532 Assert ("P32#3", true);
537 public void TestDarkSalmon ()
539 Pen pen = Pens.DarkSalmon;
540 AssertEquals ("P33#1", pen.PenType, PenType.SolidColor);
541 AssertEquals ("P33#2", pen.Color, Color.DarkSalmon);
544 pen.Color = Color.DarkSalmon;
545 Fail ("P33#3: must throw ArgumentException");
546 } catch (ArgumentException) {
547 Assert ("P33#3", true);
552 public void TestDarkSeaGreen ()
554 Pen pen = Pens.DarkSeaGreen;
555 AssertEquals ("P34#1", pen.PenType, PenType.SolidColor);
556 AssertEquals ("P34#2", pen.Color, Color.DarkSeaGreen);
559 pen.Color = Color.DarkSeaGreen;
560 Fail ("P34#3: must throw ArgumentException");
561 } catch (ArgumentException) {
562 Assert ("P34#3", true);
567 public void TestDarkSlateBlue ()
569 Pen pen = Pens.DarkSlateBlue;
570 AssertEquals ("P35#1", pen.PenType, PenType.SolidColor);
571 AssertEquals ("P35#2", pen.Color, Color.DarkSlateBlue);
574 pen.Color = Color.DarkSlateBlue;
575 Fail ("P35#3: must throw ArgumentException");
576 } catch (ArgumentException) {
577 Assert ("P35#3", true);
582 public void TestDarkSlateGray ()
584 Pen pen = Pens.DarkSlateGray;
585 AssertEquals ("P36#1", pen.PenType, PenType.SolidColor);
586 AssertEquals ("P36#2", pen.Color, Color.DarkSlateGray);
589 pen.Color = Color.DarkSlateGray;
590 Fail ("P36#3: must throw ArgumentException");
591 } catch (ArgumentException) {
592 Assert ("P36#3", true);
597 public void TestDarkTurquoise ()
599 Pen pen = Pens.DarkTurquoise;
600 AssertEquals ("P37#1", pen.PenType, PenType.SolidColor);
601 AssertEquals ("P37#2", pen.Color, Color.DarkTurquoise);
604 pen.Color = Color.DarkTurquoise;
605 Fail ("P37#3: must throw ArgumentException");
606 } catch (ArgumentException) {
607 Assert ("P37#3", true);
612 public void TestDarkViolet ()
614 Pen pen = Pens.DarkViolet;
615 AssertEquals ("P38#1", pen.PenType, PenType.SolidColor);
616 AssertEquals ("P38#2", pen.Color, Color.DarkViolet);
619 pen.Color = Color.DarkViolet;
620 Fail ("P38#3: must throw ArgumentException");
621 } catch (ArgumentException) {
622 Assert ("P38#3", true);
627 public void TestDeepPink ()
629 Pen pen = Pens.DeepPink;
630 AssertEquals ("P39#1", pen.PenType, PenType.SolidColor);
631 AssertEquals ("P39#2", pen.Color, Color.DeepPink);
634 pen.Color = Color.DeepPink;
635 Fail ("P39#3: must throw ArgumentException");
636 } catch (ArgumentException) {
637 Assert ("P39#3", true);
642 public void TestDeepSkyBlue ()
644 Pen pen = Pens.DeepSkyBlue;
645 AssertEquals ("P40#1", pen.PenType, PenType.SolidColor);
646 AssertEquals ("P40#2", pen.Color, Color.DeepSkyBlue);
649 pen.Color = Color.DeepSkyBlue;
650 Fail ("P40#3: must throw ArgumentException");
651 } catch (ArgumentException) {
652 Assert ("P40#3", true);
657 public void TestDimGray ()
659 Pen pen = Pens.DimGray;
660 AssertEquals ("P41#1", pen.PenType, PenType.SolidColor);
661 AssertEquals ("P41#2", pen.Color, Color.DimGray);
664 pen.Color = Color.DimGray;
665 Fail ("P41#3: must throw ArgumentException");
666 } catch (ArgumentException) {
667 Assert ("P41#3", true);
672 public void TestDodgerBlue ()
674 Pen pen = Pens.DodgerBlue;
675 AssertEquals ("P42#1", pen.PenType, PenType.SolidColor);
676 AssertEquals ("P42#2", pen.Color, Color.DodgerBlue);
679 pen.Color = Color.DodgerBlue;
680 Fail ("P42#3: must throw ArgumentException");
681 } catch (ArgumentException) {
682 Assert ("P42#3", true);
687 public void TestFirebrick ()
689 Pen pen = Pens.Firebrick;
690 AssertEquals ("P43#1", pen.PenType, PenType.SolidColor);
691 AssertEquals ("P43#2", pen.Color, Color.Firebrick);
694 pen.Color = Color.Firebrick;
695 Fail ("P43#3: must throw ArgumentException");
696 } catch (ArgumentException) {
697 Assert ("P43#3", true);
702 public void TestFloralWhite ()
704 Pen pen = Pens.FloralWhite;
705 AssertEquals ("P44#1", pen.PenType, PenType.SolidColor);
706 AssertEquals ("P44#2", pen.Color, Color.FloralWhite);
709 pen.Color = Color.FloralWhite;
710 Fail ("P44#3: must throw ArgumentException");
711 } catch (ArgumentException) {
712 Assert ("P44#3", true);
717 public void TestForestGreen ()
719 Pen pen = Pens.ForestGreen;
720 AssertEquals ("P45#1", pen.PenType, PenType.SolidColor);
721 AssertEquals ("P45#2", pen.Color, Color.ForestGreen);
724 pen.Color = Color.ForestGreen;
725 Fail ("P45#3: must throw ArgumentException");
726 } catch (ArgumentException) {
727 Assert ("P45#3", true);
732 public void TestFuchsia ()
734 Pen pen = Pens.Fuchsia;
735 AssertEquals ("P46#1", pen.PenType, PenType.SolidColor);
736 AssertEquals ("P46#2", pen.Color, Color.Fuchsia);
739 pen.Color = Color.Fuchsia;
740 Fail ("P46#3: must throw ArgumentException");
741 } catch (ArgumentException) {
742 Assert ("P46#3", true);
747 public void TestGainsboro ()
749 Pen pen = Pens.Gainsboro;
750 AssertEquals ("P47#1", pen.PenType, PenType.SolidColor);
751 AssertEquals ("P47#2", pen.Color, Color.Gainsboro);
754 pen.Color = Color.Gainsboro;
755 Fail ("P47#3: must throw ArgumentException");
756 } catch (ArgumentException) {
757 Assert ("P47#3", true);
762 public void TestGhostWhite ()
764 Pen pen = Pens.GhostWhite;
765 AssertEquals ("P48#1", pen.PenType, PenType.SolidColor);
766 AssertEquals ("P48#2", pen.Color, Color.GhostWhite);
769 pen.Color = Color.GhostWhite;
770 Fail ("P48#3: must throw ArgumentException");
771 } catch (ArgumentException) {
772 Assert ("P48#3", true);
777 public void TestGold ()
780 AssertEquals ("P49#1", pen.PenType, PenType.SolidColor);
781 AssertEquals ("P49#2", pen.Color, Color.Gold);
784 pen.Color = Color.Gold;
785 Fail ("P49#3: must throw ArgumentException");
786 } catch (ArgumentException) {
787 Assert ("P49#3", true);
792 public void TestGoldenrod ()
794 Pen pen = Pens.Goldenrod;
795 AssertEquals ("P50#1", pen.PenType, PenType.SolidColor);
796 AssertEquals ("P50#2", pen.Color, Color.Goldenrod);
799 pen.Color = Color.Goldenrod;
800 Fail ("P50#3: must throw ArgumentException");
801 } catch (ArgumentException) {
802 Assert ("P50#3", true);
807 public void TestGray ()
810 AssertEquals ("P51#1", pen.PenType, PenType.SolidColor);
811 AssertEquals ("P51#2", pen.Color, Color.Gray);
814 pen.Color = Color.Gray;
815 Fail ("P51#3: must throw ArgumentException");
816 } catch (ArgumentException) {
817 Assert ("P51#3", true);
822 public void TestGreen ()
824 Pen pen = Pens.Green;
825 AssertEquals ("P52#1", pen.PenType, PenType.SolidColor);
826 AssertEquals ("P52#2", pen.Color, Color.Green);
829 pen.Color = Color.Green;
830 Fail ("P52#3: must throw ArgumentException");
831 } catch (ArgumentException) {
832 Assert ("P52#3", true);
837 public void TestGreenYellow ()
839 Pen pen = Pens.GreenYellow;
840 AssertEquals ("P53#1", pen.PenType, PenType.SolidColor);
841 AssertEquals ("P53#2", pen.Color, Color.GreenYellow);
844 pen.Color = Color.GreenYellow;
845 Fail ("P53#3: must throw ArgumentException");
846 } catch (ArgumentException) {
847 Assert ("P53#3", true);
852 public void TestHoneydew ()
854 Pen pen = Pens.Honeydew;
855 AssertEquals ("P54#1", pen.PenType, PenType.SolidColor);
856 AssertEquals ("P54#2", pen.Color, Color.Honeydew);
859 pen.Color = Color.Honeydew;
860 Fail ("P54#3: must throw ArgumentException");
861 } catch (ArgumentException) {
862 Assert ("P54#3", true);
867 public void TestHotPink ()
869 Pen pen = Pens.HotPink;
870 AssertEquals ("P55#1", pen.PenType, PenType.SolidColor);
871 AssertEquals ("P55#2", pen.Color, Color.HotPink);
874 pen.Color = Color.HotPink;
875 Fail ("P55#3: must throw ArgumentException");
876 } catch (ArgumentException) {
877 Assert ("P55#3", true);
882 public void TestIndianRed ()
884 Pen pen = Pens.IndianRed;
885 AssertEquals ("P56#1", pen.PenType, PenType.SolidColor);
886 AssertEquals ("P56#2", pen.Color, Color.IndianRed);
889 pen.Color = Color.IndianRed;
890 Fail ("P56#3: must throw ArgumentException");
891 } catch (ArgumentException) {
892 Assert ("P56#3", true);
897 public void TestIndigo ()
899 Pen pen = Pens.Indigo;
900 AssertEquals ("P57#1", pen.PenType, PenType.SolidColor);
901 AssertEquals ("P57#2", pen.Color, Color.Indigo);
904 pen.Color = Color.Indigo;
905 Fail ("P57#3: must throw ArgumentException");
906 } catch (ArgumentException) {
907 Assert ("P57#3", true);
912 public void TestIvory ()
914 Pen pen = Pens.Ivory;
915 AssertEquals ("P58#1", pen.PenType, PenType.SolidColor);
916 AssertEquals ("P58#2", pen.Color, Color.Ivory);
919 pen.Color = Color.Ivory;
920 Fail ("P58#3: must throw ArgumentException");
921 } catch (ArgumentException) {
922 Assert ("P58#3", true);
927 public void TestKhaki ()
929 Pen pen = Pens.Khaki;
930 AssertEquals ("P59#1", pen.PenType, PenType.SolidColor);
931 AssertEquals ("P59#2", pen.Color, Color.Khaki);
934 pen.Color = Color.Khaki;
935 Fail ("P59#3: must throw ArgumentException");
936 } catch (ArgumentException) {
937 Assert ("P59#3", true);
942 public void TestLavender ()
944 Pen pen = Pens.Lavender;
945 AssertEquals ("P60#1", pen.PenType, PenType.SolidColor);
946 AssertEquals ("P60#2", pen.Color, Color.Lavender);
949 pen.Color = Color.Lavender;
950 Fail ("P60#3: must throw ArgumentException");
951 } catch (ArgumentException) {
952 Assert ("P60#3", true);
957 public void TestLavenderBlush ()
959 Pen pen = Pens.LavenderBlush;
960 AssertEquals ("P61#1", pen.PenType, PenType.SolidColor);
961 AssertEquals ("P61#2", pen.Color, Color.LavenderBlush);
964 pen.Color = Color.LavenderBlush;
965 Fail ("P61#3: must throw ArgumentException");
966 } catch (ArgumentException) {
967 Assert ("P61#3", true);
972 public void TestLawnGreen ()
974 Pen pen = Pens.LawnGreen;
975 AssertEquals ("P62#1", pen.PenType, PenType.SolidColor);
976 AssertEquals ("P62#2", pen.Color, Color.LawnGreen);
979 pen.Color = Color.LawnGreen;
980 Fail ("P62#3: must throw ArgumentException");
981 } catch (ArgumentException) {
982 Assert ("P62#3", true);
987 public void TestLemonChiffon ()
989 Pen pen = Pens.LemonChiffon;
990 AssertEquals ("P63#1", pen.PenType, PenType.SolidColor);
991 AssertEquals ("P63#2", pen.Color, Color.LemonChiffon);
994 pen.Color = Color.LemonChiffon;
995 Fail ("P63#3: must throw ArgumentException");
996 } catch (ArgumentException) {
997 Assert ("P63#3", true);
1002 public void TestLightBlue ()
1004 Pen pen = Pens.LightBlue;
1005 AssertEquals ("P64#1", pen.PenType, PenType.SolidColor);
1006 AssertEquals ("P64#2", pen.Color, Color.LightBlue);
1009 pen.Color = Color.LightBlue;
1010 Fail ("P64#3: must throw ArgumentException");
1011 } catch (ArgumentException) {
1012 Assert ("P64#3", true);
1017 public void TestLightCoral ()
1019 Pen pen = Pens.LightCoral;
1020 AssertEquals ("P65#1", pen.PenType, PenType.SolidColor);
1021 AssertEquals ("P65#2", pen.Color, Color.LightCoral);
1024 pen.Color = Color.LightCoral;
1025 Fail ("P65#3: must throw ArgumentException");
1026 } catch (ArgumentException) {
1027 Assert ("P65#3", true);
1032 public void TestLightCyan ()
1034 Pen pen = Pens.LightCyan;
1035 AssertEquals ("P66#1", pen.PenType, PenType.SolidColor);
1036 AssertEquals ("P66#2", pen.Color, Color.LightCyan);
1039 pen.Color = Color.LightCyan;
1040 Fail ("P66#3: must throw ArgumentException");
1041 } catch (ArgumentException) {
1042 Assert ("P66#3", true);
1047 public void TestLightGoldenrodYellow ()
1049 Pen pen = Pens.LightGoldenrodYellow;
1050 AssertEquals ("P67#1", pen.PenType, PenType.SolidColor);
1051 AssertEquals ("P67#2", pen.Color, Color.LightGoldenrodYellow);
1054 pen.Color = Color.LightGoldenrodYellow;
1055 Fail ("P67#3: must throw ArgumentException");
1056 } catch (ArgumentException) {
1057 Assert ("P67#3", true);
1062 public void TestLightGray ()
1064 Pen pen = Pens.LightGray;
1065 AssertEquals ("P68#1", pen.PenType, PenType.SolidColor);
1066 AssertEquals ("P68#2", pen.Color, Color.LightGray);
1069 pen.Color = Color.LightGray;
1070 Fail ("P68#3: must throw ArgumentException");
1071 } catch (ArgumentException) {
1072 Assert ("P68#3", true);
1077 public void TestLightGreen ()
1079 Pen pen = Pens.LightGreen;
1080 AssertEquals ("P69#1", pen.PenType, PenType.SolidColor);
1081 AssertEquals ("P69#2", pen.Color, Color.LightGreen);
1084 pen.Color = Color.LightGreen;
1085 Fail ("P69#3: must throw ArgumentException");
1086 } catch (ArgumentException) {
1087 Assert ("P69#3", true);
1092 public void TestLightPink ()
1094 Pen pen = Pens.LightPink;
1095 AssertEquals ("P70#1", pen.PenType, PenType.SolidColor);
1096 AssertEquals ("P70#2", pen.Color, Color.LightPink);
1099 pen.Color = Color.LightPink;
1100 Fail ("P70#3: must throw ArgumentException");
1101 } catch (ArgumentException) {
1102 Assert ("P70#3", true);
1107 public void TestLightSalmon ()
1109 Pen pen = Pens.LightSalmon;
1110 AssertEquals ("P71#1", pen.PenType, PenType.SolidColor);
1111 AssertEquals ("P71#2", pen.Color, Color.LightSalmon);
1114 pen.Color = Color.LightSalmon;
1115 Fail ("P71#3: must throw ArgumentException");
1116 } catch (ArgumentException) {
1117 Assert ("P71#3", true);
1122 public void TestLightSeaGreen ()
1124 Pen pen = Pens.LightSeaGreen;
1125 AssertEquals ("P72#1", pen.PenType, PenType.SolidColor);
1126 AssertEquals ("P72#2", pen.Color, Color.LightSeaGreen);
1129 pen.Color = Color.LightSeaGreen;
1130 Fail ("P72#3: must throw ArgumentException");
1131 } catch (ArgumentException) {
1132 Assert ("P72#3", true);
1137 public void TestLightSkyBlue ()
1139 Pen pen = Pens.LightSkyBlue;
1140 AssertEquals ("P73#1", pen.PenType, PenType.SolidColor);
1141 AssertEquals ("P73#2", pen.Color, Color.LightSkyBlue);
1144 pen.Color = Color.LightSkyBlue;
1145 Fail ("P73#3: must throw ArgumentException");
1146 } catch (ArgumentException) {
1147 Assert ("P73#3", true);
1152 public void TestLightSlateGray ()
1154 Pen pen = Pens.LightSlateGray;
1155 AssertEquals ("P74#1", pen.PenType, PenType.SolidColor);
1156 AssertEquals ("P74#2", pen.Color, Color.LightSlateGray);
1159 pen.Color = Color.LightSlateGray;
1160 Fail ("P74#3: must throw ArgumentException");
1161 } catch (ArgumentException) {
1162 Assert ("P74#3", true);
1167 public void TestLightSteelBlue ()
1169 Pen pen = Pens.LightSteelBlue;
1170 AssertEquals ("P75#1", pen.PenType, PenType.SolidColor);
1171 AssertEquals ("P75#2", pen.Color, Color.LightSteelBlue);
1174 pen.Color = Color.LightSteelBlue;
1175 Fail ("P75#3: must throw ArgumentException");
1176 } catch (ArgumentException) {
1177 Assert ("P75#3", true);
1182 public void TestLightYellow ()
1184 Pen pen = Pens.LightYellow;
1185 AssertEquals ("P76#1", pen.PenType, PenType.SolidColor);
1186 AssertEquals ("P76#2", pen.Color, Color.LightYellow);
1189 pen.Color = Color.LightYellow;
1190 Fail ("P76#3: must throw ArgumentException");
1191 } catch (ArgumentException) {
1192 Assert ("P76#3", true);
1197 public void TestLime ()
1199 Pen pen = Pens.Lime;
1200 AssertEquals ("P77#1", pen.PenType, PenType.SolidColor);
1201 AssertEquals ("P77#2", pen.Color, Color.Lime);
1204 pen.Color = Color.Lime;
1205 Fail ("P77#3: must throw ArgumentException");
1206 } catch (ArgumentException) {
1207 Assert ("P77#3", true);
1212 public void TestLimeGreen ()
1214 Pen pen = Pens.LimeGreen;
1215 AssertEquals ("P78#1", pen.PenType, PenType.SolidColor);
1216 AssertEquals ("P78#2", pen.Color, Color.LimeGreen);
1219 pen.Color = Color.LimeGreen;
1220 Fail ("P78#3: must throw ArgumentException");
1221 } catch (ArgumentException) {
1222 Assert ("P78#3", true);
1227 public void TestLinen ()
1229 Pen pen = Pens.Linen;
1230 AssertEquals ("P79#1", pen.PenType, PenType.SolidColor);
1231 AssertEquals ("P79#2", pen.Color, Color.Linen);
1234 pen.Color = Color.Linen;
1235 Fail ("P79#3: must throw ArgumentException");
1236 } catch (ArgumentException) {
1237 Assert ("P79#3", true);
1242 public void TestMagenta ()
1244 Pen pen = Pens.Magenta;
1245 AssertEquals ("P80#1", pen.PenType, PenType.SolidColor);
1246 AssertEquals ("P80#2", pen.Color, Color.Magenta);
1249 pen.Color = Color.Magenta;
1250 Fail ("P80#3: must throw ArgumentException");
1251 } catch (ArgumentException) {
1252 Assert ("P80#3", true);
1257 public void TestMaroon ()
1259 Pen pen = Pens.Maroon;
1260 AssertEquals ("P81#1", pen.PenType, PenType.SolidColor);
1261 AssertEquals ("P81#2", pen.Color, Color.Maroon);
1264 pen.Color = Color.Maroon;
1265 Fail ("P81#3: must throw ArgumentException");
1266 } catch (ArgumentException) {
1267 Assert ("P81#3", true);
1272 public void TestMediumAquamarine ()
1274 Pen pen = Pens.MediumAquamarine;
1275 AssertEquals ("P82#1", pen.PenType, PenType.SolidColor);
1276 AssertEquals ("P82#2", pen.Color, Color.MediumAquamarine);
1279 pen.Color = Color.MediumAquamarine;
1280 Fail ("P82#3: must throw ArgumentException");
1281 } catch (ArgumentException) {
1282 Assert ("P82#3", true);
1287 public void TestMediumBlue ()
1289 Pen pen = Pens.MediumBlue;
1290 AssertEquals ("P83#1", pen.PenType, PenType.SolidColor);
1291 AssertEquals ("P83#2", pen.Color, Color.MediumBlue);
1294 pen.Color = Color.MediumBlue;
1295 Fail ("P83#3: must throw ArgumentException");
1296 } catch (ArgumentException) {
1297 Assert ("P83#3", true);
1302 public void TestMediumOrchid ()
1304 Pen pen = Pens.MediumOrchid;
1305 AssertEquals ("P84#1", pen.PenType, PenType.SolidColor);
1306 AssertEquals ("P84#2", pen.Color, Color.MediumOrchid);
1309 pen.Color = Color.MediumOrchid;
1310 Fail ("P84#3: must throw ArgumentException");
1311 } catch (ArgumentException) {
1312 Assert ("P84#3", true);
1317 public void TestMediumPurple ()
1319 Pen pen = Pens.MediumPurple;
1320 AssertEquals ("P85#1", pen.PenType, PenType.SolidColor);
1321 AssertEquals ("P85#2", pen.Color, Color.MediumPurple);
1324 pen.Color = Color.MediumPurple;
1325 Fail ("P85#3: must throw ArgumentException");
1326 } catch (ArgumentException) {
1327 Assert ("P85#3", true);
1332 public void TestMediumSeaGreen ()
1334 Pen pen = Pens.MediumSeaGreen;
1335 AssertEquals ("P86#1", pen.PenType, PenType.SolidColor);
1336 AssertEquals ("P86#2", pen.Color, Color.MediumSeaGreen);
1339 pen.Color = Color.MediumSeaGreen;
1340 Fail ("P86#3: must throw ArgumentException");
1341 } catch (ArgumentException) {
1342 Assert ("P86#3", true);
1347 public void TestMediumSlateBlue ()
1349 Pen pen = Pens.MediumSlateBlue;
1350 AssertEquals ("P87#1", pen.PenType, PenType.SolidColor);
1351 AssertEquals ("P87#2", pen.Color, Color.MediumSlateBlue);
1354 pen.Color = Color.MediumSlateBlue;
1355 Fail ("P87#3: must throw ArgumentException");
1356 } catch (ArgumentException) {
1357 Assert ("P87#3", true);
1362 public void TestMediumSpringGreen ()
1364 Pen pen = Pens.MediumSpringGreen;
1365 AssertEquals ("P88#1", pen.PenType, PenType.SolidColor);
1366 AssertEquals ("P88#2", pen.Color, Color.MediumSpringGreen);
1369 pen.Color = Color.MediumSpringGreen;
1370 Fail ("P88#3: must throw ArgumentException");
1371 } catch (ArgumentException) {
1372 Assert ("P88#3", true);
1377 public void TestMediumTurquoise ()
1379 Pen pen = Pens.MediumTurquoise;
1380 AssertEquals ("P89#1", pen.PenType, PenType.SolidColor);
1381 AssertEquals ("P89#2", pen.Color, Color.MediumTurquoise);
1384 pen.Color = Color.MediumTurquoise;
1385 Fail ("P89#3: must throw ArgumentException");
1386 } catch (ArgumentException) {
1387 Assert ("P89#3", true);
1392 public void TestMediumVioletRed ()
1394 Pen pen = Pens.MediumVioletRed;
1395 AssertEquals ("P90#1", pen.PenType, PenType.SolidColor);
1396 AssertEquals ("P90#2", pen.Color, Color.MediumVioletRed);
1399 pen.Color = Color.MediumVioletRed;
1400 Fail ("P90#3: must throw ArgumentException");
1401 } catch (ArgumentException) {
1402 Assert ("P90#3", true);
1407 public void TestMidnightBlue ()
1409 Pen pen = Pens.MidnightBlue;
1410 AssertEquals ("P91#1", pen.PenType, PenType.SolidColor);
1411 AssertEquals ("P91#2", pen.Color, Color.MidnightBlue);
1414 pen.Color = Color.MidnightBlue;
1415 Fail ("P91#3: must throw ArgumentException");
1416 } catch (ArgumentException) {
1417 Assert ("P91#3", true);
1422 public void TestMintCream ()
1424 Pen pen = Pens.MintCream;
1425 AssertEquals ("P92#1", pen.PenType, PenType.SolidColor);
1426 AssertEquals ("P92#2", pen.Color, Color.MintCream);
1429 pen.Color = Color.MintCream;
1430 Fail ("P92#3: must throw ArgumentException");
1431 } catch (ArgumentException) {
1432 Assert ("P92#3", true);
1437 public void TestMistyRose ()
1439 Pen pen = Pens.MistyRose;
1440 AssertEquals ("P93#1", pen.PenType, PenType.SolidColor);
1441 AssertEquals ("P93#2", pen.Color, Color.MistyRose);
1444 pen.Color = Color.MistyRose;
1445 Fail ("P93#3: must throw ArgumentException");
1446 } catch (ArgumentException) {
1447 Assert ("P93#3", true);
1452 public void TestMoccasin ()
1454 Pen pen = Pens.Moccasin;
1455 AssertEquals ("P94#1", pen.PenType, PenType.SolidColor);
1456 AssertEquals ("P94#2", pen.Color, Color.Moccasin);
1459 pen.Color = Color.Moccasin;
1460 Fail ("P94#3: must throw ArgumentException");
1461 } catch (ArgumentException) {
1462 Assert ("P94#3", true);
1467 public void TestNavajoWhite ()
1469 Pen pen = Pens.NavajoWhite;
1470 AssertEquals ("P95#1", pen.PenType, PenType.SolidColor);
1471 AssertEquals ("P95#2", pen.Color, Color.NavajoWhite);
1474 pen.Color = Color.NavajoWhite;
1475 Fail ("P95#3: must throw ArgumentException");
1476 } catch (ArgumentException) {
1477 Assert ("P95#3", true);
1482 public void TestNavy ()
1484 Pen pen = Pens.Navy;
1485 AssertEquals ("P96#1", pen.PenType, PenType.SolidColor);
1486 AssertEquals ("P96#2", pen.Color, Color.Navy);
1489 pen.Color = Color.Navy;
1490 Fail ("P96#3: must throw ArgumentException");
1491 } catch (ArgumentException) {
1492 Assert ("P96#3", true);
1497 public void TestOldLace ()
1499 Pen pen = Pens.OldLace;
1500 AssertEquals ("P97#1", pen.PenType, PenType.SolidColor);
1501 AssertEquals ("P97#2", pen.Color, Color.OldLace);
1504 pen.Color = Color.OldLace;
1505 Fail ("P97#3: must throw ArgumentException");
1506 } catch (ArgumentException) {
1507 Assert ("P97#3", true);
1512 public void TestOlive ()
1514 Pen pen = Pens.Olive;
1515 AssertEquals ("P98#1", pen.PenType, PenType.SolidColor);
1516 AssertEquals ("P98#2", pen.Color, Color.Olive);
1519 pen.Color = Color.Olive;
1520 Fail ("P98#3: must throw ArgumentException");
1521 } catch (ArgumentException) {
1522 Assert ("P98#3", true);
1527 public void TestOliveDrab ()
1529 Pen pen = Pens.OliveDrab;
1530 AssertEquals ("P99#1", pen.PenType, PenType.SolidColor);
1531 AssertEquals ("P99#2", pen.Color, Color.OliveDrab);
1534 pen.Color = Color.OliveDrab;
1535 Fail ("P99#3: must throw ArgumentException");
1536 } catch (ArgumentException) {
1537 Assert ("P99#3", true);
1542 public void TestOrange ()
1544 Pen pen = Pens.Orange;
1545 AssertEquals ("P100#1", pen.PenType, PenType.SolidColor);
1546 AssertEquals ("P100#2", pen.Color, Color.Orange);
1549 pen.Color = Color.Orange;
1550 Fail ("P100#3: must throw ArgumentException");
1551 } catch (ArgumentException) {
1552 Assert ("P100#3", true);
1557 public void TestOrangeRed ()
1559 Pen pen = Pens.OrangeRed;
1560 AssertEquals ("P101#1", pen.PenType, PenType.SolidColor);
1561 AssertEquals ("P101#2", pen.Color, Color.OrangeRed);
1564 pen.Color = Color.OrangeRed;
1565 Fail ("P101#3: must throw ArgumentException");
1566 } catch (ArgumentException) {
1567 Assert ("P101#3", true);
1572 public void TestOrchid ()
1574 Pen pen = Pens.Orchid;
1575 AssertEquals ("P102#1", pen.PenType, PenType.SolidColor);
1576 AssertEquals ("P102#2", pen.Color, Color.Orchid);
1579 pen.Color = Color.Orchid;
1580 Fail ("P102#3: must throw ArgumentException");
1581 } catch (ArgumentException) {
1582 Assert ("P102#3", true);
1587 public void TestPaleGoldenrod ()
1589 Pen pen = Pens.PaleGoldenrod;
1590 AssertEquals ("P103#1", pen.PenType, PenType.SolidColor);
1591 AssertEquals ("P103#2", pen.Color, Color.PaleGoldenrod);
1594 pen.Color = Color.PaleGoldenrod;
1595 Fail ("P103#3: must throw ArgumentException");
1596 } catch (ArgumentException) {
1597 Assert ("P103#3", true);
1602 public void TestPaleGreen ()
1604 Pen pen = Pens.PaleGreen;
1605 AssertEquals ("P104#1", pen.PenType, PenType.SolidColor);
1606 AssertEquals ("P104#2", pen.Color, Color.PaleGreen);
1609 pen.Color = Color.PaleGreen;
1610 Fail ("P104#3: must throw ArgumentException");
1611 } catch (ArgumentException) {
1612 Assert ("P104#3", true);
1617 public void TestPaleTurquoise ()
1619 Pen pen = Pens.PaleTurquoise;
1620 AssertEquals ("P105#1", pen.PenType, PenType.SolidColor);
1621 AssertEquals ("P105#2", pen.Color, Color.PaleTurquoise);
1624 pen.Color = Color.PaleTurquoise;
1625 Fail ("P105#3: must throw ArgumentException");
1626 } catch (ArgumentException) {
1627 Assert ("P105#3", true);
1632 public void TestPaleVioletRed ()
1634 Pen pen = Pens.PaleVioletRed;
1635 AssertEquals ("P106#1", pen.PenType, PenType.SolidColor);
1636 AssertEquals ("P106#2", pen.Color, Color.PaleVioletRed);
1639 pen.Color = Color.PaleVioletRed;
1640 Fail ("P106#3: must throw ArgumentException");
1641 } catch (ArgumentException) {
1642 Assert ("P106#3", true);
1647 public void TestPapayaWhip ()
1649 Pen pen = Pens.PapayaWhip;
1650 AssertEquals ("P107#1", pen.PenType, PenType.SolidColor);
1651 AssertEquals ("P107#2", pen.Color, Color.PapayaWhip);
1654 pen.Color = Color.PapayaWhip;
1655 Fail ("P107#3: must throw ArgumentException");
1656 } catch (ArgumentException) {
1657 Assert ("P107#3", true);
1662 public void TestPeachPuff ()
1664 Pen pen = Pens.PeachPuff;
1665 AssertEquals ("P108#1", pen.PenType, PenType.SolidColor);
1666 AssertEquals ("P108#2", pen.Color, Color.PeachPuff);
1669 pen.Color = Color.PeachPuff;
1670 Fail ("P108#3: must throw ArgumentException");
1671 } catch (ArgumentException) {
1672 Assert ("P108#3", true);
1677 public void TestPeru ()
1679 Pen pen = Pens.Peru;
1680 AssertEquals ("P109#1", pen.PenType, PenType.SolidColor);
1681 AssertEquals ("P109#2", pen.Color, Color.Peru);
1684 pen.Color = Color.Peru;
1685 Fail ("P109#3: must throw ArgumentException");
1686 } catch (ArgumentException) {
1687 Assert ("P109#3", true);
1692 public void TestPink ()
1694 Pen pen = Pens.Pink;
1695 AssertEquals ("P110#1", pen.PenType, PenType.SolidColor);
1696 AssertEquals ("P110#2", pen.Color, Color.Pink);
1699 pen.Color = Color.Pink;
1700 Fail ("P110#3: must throw ArgumentException");
1701 } catch (ArgumentException) {
1702 Assert ("P110#3", true);
1707 public void TestPlum ()
1709 Pen pen = Pens.Plum;
1710 AssertEquals ("P111#1", pen.PenType, PenType.SolidColor);
1711 AssertEquals ("P111#2", pen.Color, Color.Plum);
1714 pen.Color = Color.Plum;
1715 Fail ("P111#3: must throw ArgumentException");
1716 } catch (ArgumentException) {
1717 Assert ("P111#3", true);
1722 public void TestPowderBlue ()
1724 Pen pen = Pens.PowderBlue;
1725 AssertEquals ("P112#1", pen.PenType, PenType.SolidColor);
1726 AssertEquals ("P112#2", pen.Color, Color.PowderBlue);
1729 pen.Color = Color.PowderBlue;
1730 Fail ("P112#3: must throw ArgumentException");
1731 } catch (ArgumentException) {
1732 Assert ("P112#3", true);
1737 public void TestPurple ()
1739 Pen pen = Pens.Purple;
1740 AssertEquals ("P113#1", pen.PenType, PenType.SolidColor);
1741 AssertEquals ("P113#2", pen.Color, Color.Purple);
1744 pen.Color = Color.Purple;
1745 Fail ("P113#3: must throw ArgumentException");
1746 } catch (ArgumentException) {
1747 Assert ("P113#3", true);
1752 public void TestRed ()
1755 AssertEquals ("P114#1", pen.PenType, PenType.SolidColor);
1756 AssertEquals ("P114#2", pen.Color, Color.Red);
1759 pen.Color = Color.Red;
1760 Fail ("P114#3: must throw ArgumentException");
1761 } catch (ArgumentException) {
1762 Assert ("P114#3", true);
1767 public void TestRosyBrown ()
1769 Pen pen = Pens.RosyBrown;
1770 AssertEquals ("P115#1", pen.PenType, PenType.SolidColor);
1771 AssertEquals ("P115#2", pen.Color, Color.RosyBrown);
1774 pen.Color = Color.RosyBrown;
1775 Fail ("P115#3: must throw ArgumentException");
1776 } catch (ArgumentException) {
1777 Assert ("P115#3", true);
1782 public void TestRoyalBlue ()
1784 Pen pen = Pens.RoyalBlue;
1785 AssertEquals ("P116#1", pen.PenType, PenType.SolidColor);
1786 AssertEquals ("P116#2", pen.Color, Color.RoyalBlue);
1789 pen.Color = Color.RoyalBlue;
1790 Fail ("P116#3: must throw ArgumentException");
1791 } catch (ArgumentException) {
1792 Assert ("P116#3", true);
1797 public void TestSaddleBrown ()
1799 Pen pen = Pens.SaddleBrown;
1800 AssertEquals ("P117#1", pen.PenType, PenType.SolidColor);
1801 AssertEquals ("P117#2", pen.Color, Color.SaddleBrown);
1804 pen.Color = Color.SaddleBrown;
1805 Fail ("P117#3: must throw ArgumentException");
1806 } catch (ArgumentException) {
1807 Assert ("P117#3", true);
1812 public void TestSalmon ()
1814 Pen pen = Pens.Salmon;
1815 AssertEquals ("P118#1", pen.PenType, PenType.SolidColor);
1816 AssertEquals ("P118#2", pen.Color, Color.Salmon);
1819 pen.Color = Color.Salmon;
1820 Fail ("P118#3: must throw ArgumentException");
1821 } catch (ArgumentException) {
1822 Assert ("P118#3", true);
1827 public void TestSandyBrown ()
1829 Pen pen = Pens.SandyBrown;
1830 AssertEquals ("P119#1", pen.PenType, PenType.SolidColor);
1831 AssertEquals ("P119#2", pen.Color, Color.SandyBrown);
1834 pen.Color = Color.SandyBrown;
1835 Fail ("P119#3: must throw ArgumentException");
1836 } catch (ArgumentException) {
1837 Assert ("P119#3", true);
1842 public void TestSeaGreen ()
1844 Pen pen = Pens.SeaGreen;
1845 AssertEquals ("P120#1", pen.PenType, PenType.SolidColor);
1846 AssertEquals ("P120#2", pen.Color, Color.SeaGreen);
1849 pen.Color = Color.SeaGreen;
1850 Fail ("P120#3: must throw ArgumentException");
1851 } catch (ArgumentException) {
1852 Assert ("P120#3", true);
1857 public void TestSeaShell ()
1859 Pen pen = Pens.SeaShell;
1860 AssertEquals ("P121#1", pen.PenType, PenType.SolidColor);
1861 AssertEquals ("P121#2", pen.Color, Color.SeaShell);
1864 pen.Color = Color.SeaShell;
1865 Fail ("P121#3: must throw ArgumentException");
1866 } catch (ArgumentException) {
1867 Assert ("P121#3", true);
1872 public void TestSienna ()
1874 Pen pen = Pens.Sienna;
1875 AssertEquals ("P122#1", pen.PenType, PenType.SolidColor);
1876 AssertEquals ("P122#2", pen.Color, Color.Sienna);
1879 pen.Color = Color.Sienna;
1880 Fail ("P122#3: must throw ArgumentException");
1881 } catch (ArgumentException) {
1882 Assert ("P122#3", true);
1887 public void TestSilver ()
1889 Pen pen = Pens.Silver;
1890 AssertEquals ("P123#1", pen.PenType, PenType.SolidColor);
1891 AssertEquals ("P123#2", pen.Color, Color.Silver);
1894 pen.Color = Color.Silver;
1895 Fail ("P123#3: must throw ArgumentException");
1896 } catch (ArgumentException) {
1897 Assert ("P123#3", true);
1902 public void TestSkyBlue ()
1904 Pen pen = Pens.SkyBlue;
1905 AssertEquals ("P124#1", pen.PenType, PenType.SolidColor);
1906 AssertEquals ("P124#2", pen.Color, Color.SkyBlue);
1909 pen.Color = Color.SkyBlue;
1910 Fail ("P124#3: must throw ArgumentException");
1911 } catch (ArgumentException) {
1912 Assert ("P124#3", true);
1917 public void TestSlateBlue ()
1919 Pen pen = Pens.SlateBlue;
1920 AssertEquals ("P125#1", pen.PenType, PenType.SolidColor);
1921 AssertEquals ("P125#2", pen.Color, Color.SlateBlue);
1924 pen.Color = Color.SlateBlue;
1925 Fail ("P125#3: must throw ArgumentException");
1926 } catch (ArgumentException) {
1927 Assert ("P125#3", true);
1932 public void TestSlateGray ()
1934 Pen pen = Pens.SlateGray;
1935 AssertEquals ("P126#1", pen.PenType, PenType.SolidColor);
1936 AssertEquals ("P126#2", pen.Color, Color.SlateGray);
1939 pen.Color = Color.SlateGray;
1940 Fail ("P126#3: must throw ArgumentException");
1941 } catch (ArgumentException) {
1942 Assert ("P126#3", true);
1947 public void TestSnow ()
1949 Pen pen = Pens.Snow;
1950 AssertEquals ("P127#1", pen.PenType, PenType.SolidColor);
1951 AssertEquals ("P127#2", pen.Color, Color.Snow);
1954 pen.Color = Color.Snow;
1955 Fail ("P127#3: must throw ArgumentException");
1956 } catch (ArgumentException) {
1957 Assert ("P127#3", true);
1962 public void TestSpringGreen ()
1964 Pen pen = Pens.SpringGreen;
1965 AssertEquals ("P128#1", pen.PenType, PenType.SolidColor);
1966 AssertEquals ("P128#2", pen.Color, Color.SpringGreen);
1969 pen.Color = Color.SpringGreen;
1970 Fail ("P128#3: must throw ArgumentException");
1971 } catch (ArgumentException) {
1972 Assert ("P128#3", true);
1977 public void TestSteelBlue ()
1979 Pen pen = Pens.SteelBlue;
1980 AssertEquals ("P129#1", pen.PenType, PenType.SolidColor);
1981 AssertEquals ("P129#2", pen.Color, Color.SteelBlue);
1984 pen.Color = Color.SteelBlue;
1985 Fail ("P129#3: must throw ArgumentException");
1986 } catch (ArgumentException) {
1987 Assert ("P129#3", true);
1992 public void TestTan ()
1995 AssertEquals ("P130#1", pen.PenType, PenType.SolidColor);
1996 AssertEquals ("P130#2", pen.Color, Color.Tan);
1999 pen.Color = Color.Tan;
2000 Fail ("P130#3: must throw ArgumentException");
2001 } catch (ArgumentException) {
2002 Assert ("P130#3", true);
2007 public void TestTeal ()
2009 Pen pen = Pens.Teal;
2010 AssertEquals ("P131#1", pen.PenType, PenType.SolidColor);
2011 AssertEquals ("P131#2", pen.Color, Color.Teal);
2014 pen.Color = Color.Teal;
2015 Fail ("P131#3: must throw ArgumentException");
2016 } catch (ArgumentException) {
2017 Assert ("P131#3", true);
2022 public void TestThistle ()
2024 Pen pen = Pens.Thistle;
2025 AssertEquals ("P132#1", pen.PenType, PenType.SolidColor);
2026 AssertEquals ("P132#2", pen.Color, Color.Thistle);
2029 pen.Color = Color.Thistle;
2030 Fail ("P132#3: must throw ArgumentException");
2031 } catch (ArgumentException) {
2032 Assert ("P132#3", true);
2037 public void TestTomato ()
2039 Pen pen = Pens.Tomato;
2040 AssertEquals ("P133#1", pen.PenType, PenType.SolidColor);
2041 AssertEquals ("P133#2", pen.Color, Color.Tomato);
2044 pen.Color = Color.Tomato;
2045 Fail ("P133#3: must throw ArgumentException");
2046 } catch (ArgumentException) {
2047 Assert ("P133#3", true);
2052 public void TestTransparent ()
2054 Pen pen = Pens.Transparent;
2055 AssertEquals ("P134#1", pen.PenType, PenType.SolidColor);
2056 AssertEquals ("P134#2", pen.Color, Color.Transparent);
2059 pen.Color = Color.Transparent;
2060 Fail ("P134#3: must throw ArgumentException");
2061 } catch (ArgumentException) {
2062 Assert ("P134#3", true);
2067 public void TestTurquoise ()
2069 Pen pen = Pens.Turquoise;
2070 AssertEquals ("P135#1", pen.PenType, PenType.SolidColor);
2071 AssertEquals ("P135#2", pen.Color, Color.Turquoise);
2074 pen.Color = Color.Turquoise;
2075 Fail ("P135#3: must throw ArgumentException");
2076 } catch (ArgumentException) {
2077 Assert ("P135#3", true);
2082 public void TestViolet ()
2084 Pen pen = Pens.Violet;
2085 AssertEquals ("P136#1", pen.PenType, PenType.SolidColor);
2086 AssertEquals ("P136#2", pen.Color, Color.Violet);
2089 pen.Color = Color.Violet;
2090 Fail ("P136#3: must throw ArgumentException");
2091 } catch (ArgumentException) {
2092 Assert ("P136#3", true);
2097 public void TestWheat ()
2099 Pen pen = Pens.Wheat;
2100 AssertEquals ("P137#1", pen.PenType, PenType.SolidColor);
2101 AssertEquals ("P137#2", pen.Color, Color.Wheat);
2104 pen.Color = Color.Wheat;
2105 Fail ("P137#3: must throw ArgumentException");
2106 } catch (ArgumentException) {
2107 Assert ("P137#3", true);
2112 public void TestWhite ()
2114 Pen pen = Pens.White;
2115 AssertEquals ("P138#1", pen.PenType, PenType.SolidColor);
2116 AssertEquals ("P138#2", pen.Color, Color.White);
2119 pen.Color = Color.White;
2120 Fail ("P138#3: must throw ArgumentException");
2121 } catch (ArgumentException) {
2122 Assert ("P138#3", true);
2127 public void TestWhiteSmoke ()
2129 Pen pen = Pens.WhiteSmoke;
2130 AssertEquals ("P139#1", pen.PenType, PenType.SolidColor);
2131 AssertEquals ("P139#2", pen.Color, Color.WhiteSmoke);
2134 pen.Color = Color.WhiteSmoke;
2135 Fail ("P139#3: must throw ArgumentException");
2136 } catch (ArgumentException) {
2137 Assert ("P139#3", true);
2142 public void TestYellow ()
2144 Pen pen = Pens.Yellow;
2145 AssertEquals ("P140#1", pen.PenType, PenType.SolidColor);
2146 AssertEquals ("P140#2", pen.Color, Color.Yellow);
2149 pen.Color = Color.Yellow;
2150 Fail ("P140#3: must throw ArgumentException");
2151 } catch (ArgumentException) {
2152 Assert ("P140#3", true);
2157 public void TestYellowGreen ()
2159 Pen pen = Pens.YellowGreen;
2160 AssertEquals ("P141#1", pen.PenType, PenType.SolidColor);
2161 AssertEquals ("P141#2", pen.Color, Color.YellowGreen);
2164 pen.Color = Color.YellowGreen;
2165 Fail ("P141#3: must throw ArgumentException");
2166 } catch (ArgumentException) {
2167 Assert ("P141#3", true);
2173 // Following code was used to generate the test methods above
2175 //Type type = typeof (Pens);
2176 //PropertyInfo [] properties = type.GetProperties ();
2178 //foreach (PropertyInfo property in properties) {
2179 // Console.WriteLine();
2180 // Console.WriteLine("\t\t[Test]");
2181 // Console.WriteLine("\t\tpublic void Test" + property.Name + " ()");
2182 // Console.WriteLine("\t\t{");
2183 // Console.WriteLine("\t\t\tPen pen = Pens." + property.Name + ";");
2184 // Console.WriteLine("\t\t\tAssertEquals (\"P" + count + "#1\", pen.PenType, PenType.SolidColor);");
2185 // Console.WriteLine("\t\t\tAssertEquals (\"P" + count + "#2\", pen.Color, Color." + property.Name + ");\n");
2187 // Console.WriteLine("\t\t\ttry {");
2188 // Console.WriteLine("\t\t\t\tpen.Color = Color." + property.Name + ";");
2189 // Console.WriteLine("\t\t\t\tFail (\"P" + count + "#3: must throw ArgumentException\");");
2190 // Console.WriteLine("\t\t\t} catch (ArgumentException) {");
2191 // Console.WriteLine("\t\t\t\tAssert (\"P" + count + "#3\", true);");
2192 // Console.WriteLine("\t\t\t}");
2193 // Console.WriteLine("\t\t}");