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 TestAliceBlue ()
50 Pen pen = Pens.AliceBlue;
51 AssertEquals ("P1#1", pen.PenType, PenType.SolidColor);
52 AssertEquals ("P1#2", pen.Color, Color.AliceBlue);
55 pen.Color = Color.AliceBlue;
56 Fail ("P1#3: must throw ArgumentException");
57 } catch (ArgumentException) {
58 Assert ("P1#3", true);
63 public void TestAntiqueWhite ()
65 Pen pen = Pens.AntiqueWhite;
66 AssertEquals ("P2#1", pen.PenType, PenType.SolidColor);
67 AssertEquals ("P2#2", pen.Color, Color.AntiqueWhite);
70 pen.Color = Color.AntiqueWhite;
71 Fail ("P2#3: must throw ArgumentException");
72 } catch (ArgumentException) {
73 Assert ("P2#3", true);
78 public void TestAqua ()
81 AssertEquals ("P3#1", pen.PenType, PenType.SolidColor);
82 AssertEquals ("P3#2", pen.Color, Color.Aqua);
85 pen.Color = Color.Aqua;
86 Fail ("P3#3: must throw ArgumentException");
87 } catch (ArgumentException) {
88 Assert ("P3#3", true);
93 public void TestAquamarine ()
95 Pen pen = Pens.Aquamarine;
96 AssertEquals ("P4#1", pen.PenType, PenType.SolidColor);
97 AssertEquals ("P4#2", pen.Color, Color.Aquamarine);
100 pen.Color = Color.Aquamarine;
101 Fail ("P4#3: must throw ArgumentException");
102 } catch (ArgumentException) {
103 Assert ("P4#3", true);
108 public void TestAzure ()
110 Pen pen = Pens.Azure;
111 AssertEquals ("P5#1", pen.PenType, PenType.SolidColor);
112 AssertEquals ("P5#2", pen.Color, Color.Azure);
115 pen.Color = Color.Azure;
116 Fail ("P5#3: must throw ArgumentException");
117 } catch (ArgumentException) {
118 Assert ("P5#3", true);
123 public void TestBeige ()
125 Pen pen = Pens.Beige;
126 AssertEquals ("P6#1", pen.PenType, PenType.SolidColor);
127 AssertEquals ("P6#2", pen.Color, Color.Beige);
130 pen.Color = Color.Beige;
131 Fail ("P6#3: must throw ArgumentException");
132 } catch (ArgumentException) {
133 Assert ("P6#3", true);
138 public void TestBisque ()
140 Pen pen = Pens.Bisque;
141 AssertEquals ("P7#1", pen.PenType, PenType.SolidColor);
142 AssertEquals ("P7#2", pen.Color, Color.Bisque);
145 pen.Color = Color.Bisque;
146 Fail ("P7#3: must throw ArgumentException");
147 } catch (ArgumentException) {
148 Assert ("P7#3", true);
153 public void TestBlack ()
155 Pen pen = Pens.Black;
156 AssertEquals ("P8#1", pen.PenType, PenType.SolidColor);
157 AssertEquals ("P8#2", pen.Color, Color.Black);
160 pen.Color = Color.Black;
161 Fail ("P8#3: must throw ArgumentException");
162 } catch (ArgumentException) {
163 Assert ("P8#3", true);
168 public void TestBlanchedAlmond ()
170 Pen pen = Pens.BlanchedAlmond;
171 AssertEquals ("P9#1", pen.PenType, PenType.SolidColor);
172 AssertEquals ("P9#2", pen.Color, Color.BlanchedAlmond);
175 pen.Color = Color.BlanchedAlmond;
176 Fail ("P9#3: must throw ArgumentException");
177 } catch (ArgumentException) {
178 Assert ("P9#3", true);
183 public void TestBlue ()
186 AssertEquals ("P10#1", pen.PenType, PenType.SolidColor);
187 AssertEquals ("P10#2", pen.Color, Color.Blue);
190 pen.Color = Color.Blue;
191 Fail ("P10#3: must throw ArgumentException");
192 } catch (ArgumentException) {
193 Assert ("P10#3", true);
198 public void TestBlueViolet ()
200 Pen pen = Pens.BlueViolet;
201 AssertEquals ("P11#1", pen.PenType, PenType.SolidColor);
202 AssertEquals ("P11#2", pen.Color, Color.BlueViolet);
205 pen.Color = Color.BlueViolet;
206 Fail ("P11#3: must throw ArgumentException");
207 } catch (ArgumentException) {
208 Assert ("P11#3", true);
213 public void TestBrown ()
215 Pen pen = Pens.Brown;
216 AssertEquals ("P12#1", pen.PenType, PenType.SolidColor);
217 AssertEquals ("P12#2", pen.Color, Color.Brown);
220 pen.Color = Color.Brown;
221 Fail ("P12#3: must throw ArgumentException");
222 } catch (ArgumentException) {
223 Assert ("P12#3", true);
228 public void TestBurlyWood ()
230 Pen pen = Pens.BurlyWood;
231 AssertEquals ("P13#1", pen.PenType, PenType.SolidColor);
232 AssertEquals ("P13#2", pen.Color, Color.BurlyWood);
235 pen.Color = Color.BurlyWood;
236 Fail ("P13#3: must throw ArgumentException");
237 } catch (ArgumentException) {
238 Assert ("P13#3", true);
243 public void TestCadetBlue ()
245 Pen pen = Pens.CadetBlue;
246 AssertEquals ("P14#1", pen.PenType, PenType.SolidColor);
247 AssertEquals ("P14#2", pen.Color, Color.CadetBlue);
250 pen.Color = Color.CadetBlue;
251 Fail ("P14#3: must throw ArgumentException");
252 } catch (ArgumentException) {
253 Assert ("P14#3", true);
258 public void TestChartreuse ()
260 Pen pen = Pens.Chartreuse;
261 AssertEquals ("P15#1", pen.PenType, PenType.SolidColor);
262 AssertEquals ("P15#2", pen.Color, Color.Chartreuse);
265 pen.Color = Color.Chartreuse;
266 Fail ("P15#3: must throw ArgumentException");
267 } catch (ArgumentException) {
268 Assert ("P15#3", true);
273 public void TestChocolate ()
275 Pen pen = Pens.Chocolate;
276 AssertEquals ("P16#1", pen.PenType, PenType.SolidColor);
277 AssertEquals ("P16#2", pen.Color, Color.Chocolate);
280 pen.Color = Color.Chocolate;
281 Fail ("P16#3: must throw ArgumentException");
282 } catch (ArgumentException) {
283 Assert ("P16#3", true);
288 public void TestCoral ()
290 Pen pen = Pens.Coral;
291 AssertEquals ("P17#1", pen.PenType, PenType.SolidColor);
292 AssertEquals ("P17#2", pen.Color, Color.Coral);
295 pen.Color = Color.Coral;
296 Fail ("P17#3: must throw ArgumentException");
297 } catch (ArgumentException) {
298 Assert ("P17#3", true);
303 public void TestCornflowerBlue ()
305 Pen pen = Pens.CornflowerBlue;
306 AssertEquals ("P18#1", pen.PenType, PenType.SolidColor);
307 AssertEquals ("P18#2", pen.Color, Color.CornflowerBlue);
310 pen.Color = Color.CornflowerBlue;
311 Fail ("P18#3: must throw ArgumentException");
312 } catch (ArgumentException) {
313 Assert ("P18#3", true);
318 public void TestCornsilk ()
320 Pen pen = Pens.Cornsilk;
321 AssertEquals ("P19#1", pen.PenType, PenType.SolidColor);
322 AssertEquals ("P19#2", pen.Color, Color.Cornsilk);
325 pen.Color = Color.Cornsilk;
326 Fail ("P19#3: must throw ArgumentException");
327 } catch (ArgumentException) {
328 Assert ("P19#3", true);
333 public void TestCrimson ()
335 Pen pen = Pens.Crimson;
336 AssertEquals ("P20#1", pen.PenType, PenType.SolidColor);
337 AssertEquals ("P20#2", pen.Color, Color.Crimson);
340 pen.Color = Color.Crimson;
341 Fail ("P20#3: must throw ArgumentException");
342 } catch (ArgumentException) {
343 Assert ("P20#3", true);
348 public void TestCyan ()
351 AssertEquals ("P21#1", pen.PenType, PenType.SolidColor);
352 AssertEquals ("P21#2", pen.Color, Color.Cyan);
355 pen.Color = Color.Cyan;
356 Fail ("P21#3: must throw ArgumentException");
357 } catch (ArgumentException) {
358 Assert ("P21#3", true);
363 public void TestDarkBlue ()
365 Pen pen = Pens.DarkBlue;
366 AssertEquals ("P22#1", pen.PenType, PenType.SolidColor);
367 AssertEquals ("P22#2", pen.Color, Color.DarkBlue);
370 pen.Color = Color.DarkBlue;
371 Fail ("P22#3: must throw ArgumentException");
372 } catch (ArgumentException) {
373 Assert ("P22#3", true);
378 public void TestDarkCyan ()
380 Pen pen = Pens.DarkCyan;
381 AssertEquals ("P23#1", pen.PenType, PenType.SolidColor);
382 AssertEquals ("P23#2", pen.Color, Color.DarkCyan);
385 pen.Color = Color.DarkCyan;
386 Fail ("P23#3: must throw ArgumentException");
387 } catch (ArgumentException) {
388 Assert ("P23#3", true);
393 public void TestDarkGoldenrod ()
395 Pen pen = Pens.DarkGoldenrod;
396 AssertEquals ("P24#1", pen.PenType, PenType.SolidColor);
397 AssertEquals ("P24#2", pen.Color, Color.DarkGoldenrod);
400 pen.Color = Color.DarkGoldenrod;
401 Fail ("P24#3: must throw ArgumentException");
402 } catch (ArgumentException) {
403 Assert ("P24#3", true);
408 public void TestDarkGray ()
410 Pen pen = Pens.DarkGray;
411 AssertEquals ("P25#1", pen.PenType, PenType.SolidColor);
412 AssertEquals ("P25#2", pen.Color, Color.DarkGray);
415 pen.Color = Color.DarkGray;
416 Fail ("P25#3: must throw ArgumentException");
417 } catch (ArgumentException) {
418 Assert ("P25#3", true);
423 public void TestDarkGreen ()
425 Pen pen = Pens.DarkGreen;
426 AssertEquals ("P26#1", pen.PenType, PenType.SolidColor);
427 AssertEquals ("P26#2", pen.Color, Color.DarkGreen);
430 pen.Color = Color.DarkGreen;
431 Fail ("P26#3: must throw ArgumentException");
432 } catch (ArgumentException) {
433 Assert ("P26#3", true);
438 public void TestDarkKhaki ()
440 Pen pen = Pens.DarkKhaki;
441 AssertEquals ("P27#1", pen.PenType, PenType.SolidColor);
442 AssertEquals ("P27#2", pen.Color, Color.DarkKhaki);
445 pen.Color = Color.DarkKhaki;
446 Fail ("P27#3: must throw ArgumentException");
447 } catch (ArgumentException) {
448 Assert ("P27#3", true);
453 public void TestDarkMagenta ()
455 Pen pen = Pens.DarkMagenta;
456 AssertEquals ("P28#1", pen.PenType, PenType.SolidColor);
457 AssertEquals ("P28#2", pen.Color, Color.DarkMagenta);
460 pen.Color = Color.DarkMagenta;
461 Fail ("P28#3: must throw ArgumentException");
462 } catch (ArgumentException) {
463 Assert ("P28#3", true);
468 public void TestDarkOliveGreen ()
470 Pen pen = Pens.DarkOliveGreen;
471 AssertEquals ("P29#1", pen.PenType, PenType.SolidColor);
472 AssertEquals ("P29#2", pen.Color, Color.DarkOliveGreen);
475 pen.Color = Color.DarkOliveGreen;
476 Fail ("P29#3: must throw ArgumentException");
477 } catch (ArgumentException) {
478 Assert ("P29#3", true);
483 public void TestDarkOrange ()
485 Pen pen = Pens.DarkOrange;
486 AssertEquals ("P30#1", pen.PenType, PenType.SolidColor);
487 AssertEquals ("P30#2", pen.Color, Color.DarkOrange);
490 pen.Color = Color.DarkOrange;
491 Fail ("P30#3: must throw ArgumentException");
492 } catch (ArgumentException) {
493 Assert ("P30#3", true);
498 public void TestDarkOrchid ()
500 Pen pen = Pens.DarkOrchid;
501 AssertEquals ("P31#1", pen.PenType, PenType.SolidColor);
502 AssertEquals ("P31#2", pen.Color, Color.DarkOrchid);
505 pen.Color = Color.DarkOrchid;
506 Fail ("P31#3: must throw ArgumentException");
507 } catch (ArgumentException) {
508 Assert ("P31#3", true);
513 public void TestDarkRed ()
515 Pen pen = Pens.DarkRed;
516 AssertEquals ("P32#1", pen.PenType, PenType.SolidColor);
517 AssertEquals ("P32#2", pen.Color, Color.DarkRed);
520 pen.Color = Color.DarkRed;
521 Fail ("P32#3: must throw ArgumentException");
522 } catch (ArgumentException) {
523 Assert ("P32#3", true);
528 public void TestDarkSalmon ()
530 Pen pen = Pens.DarkSalmon;
531 AssertEquals ("P33#1", pen.PenType, PenType.SolidColor);
532 AssertEquals ("P33#2", pen.Color, Color.DarkSalmon);
535 pen.Color = Color.DarkSalmon;
536 Fail ("P33#3: must throw ArgumentException");
537 } catch (ArgumentException) {
538 Assert ("P33#3", true);
543 public void TestDarkSeaGreen ()
545 Pen pen = Pens.DarkSeaGreen;
546 AssertEquals ("P34#1", pen.PenType, PenType.SolidColor);
547 AssertEquals ("P34#2", pen.Color, Color.DarkSeaGreen);
550 pen.Color = Color.DarkSeaGreen;
551 Fail ("P34#3: must throw ArgumentException");
552 } catch (ArgumentException) {
553 Assert ("P34#3", true);
558 public void TestDarkSlateBlue ()
560 Pen pen = Pens.DarkSlateBlue;
561 AssertEquals ("P35#1", pen.PenType, PenType.SolidColor);
562 AssertEquals ("P35#2", pen.Color, Color.DarkSlateBlue);
565 pen.Color = Color.DarkSlateBlue;
566 Fail ("P35#3: must throw ArgumentException");
567 } catch (ArgumentException) {
568 Assert ("P35#3", true);
573 public void TestDarkSlateGray ()
575 Pen pen = Pens.DarkSlateGray;
576 AssertEquals ("P36#1", pen.PenType, PenType.SolidColor);
577 AssertEquals ("P36#2", pen.Color, Color.DarkSlateGray);
580 pen.Color = Color.DarkSlateGray;
581 Fail ("P36#3: must throw ArgumentException");
582 } catch (ArgumentException) {
583 Assert ("P36#3", true);
588 public void TestDarkTurquoise ()
590 Pen pen = Pens.DarkTurquoise;
591 AssertEquals ("P37#1", pen.PenType, PenType.SolidColor);
592 AssertEquals ("P37#2", pen.Color, Color.DarkTurquoise);
595 pen.Color = Color.DarkTurquoise;
596 Fail ("P37#3: must throw ArgumentException");
597 } catch (ArgumentException) {
598 Assert ("P37#3", true);
603 public void TestDarkViolet ()
605 Pen pen = Pens.DarkViolet;
606 AssertEquals ("P38#1", pen.PenType, PenType.SolidColor);
607 AssertEquals ("P38#2", pen.Color, Color.DarkViolet);
610 pen.Color = Color.DarkViolet;
611 Fail ("P38#3: must throw ArgumentException");
612 } catch (ArgumentException) {
613 Assert ("P38#3", true);
618 public void TestDeepPink ()
620 Pen pen = Pens.DeepPink;
621 AssertEquals ("P39#1", pen.PenType, PenType.SolidColor);
622 AssertEquals ("P39#2", pen.Color, Color.DeepPink);
625 pen.Color = Color.DeepPink;
626 Fail ("P39#3: must throw ArgumentException");
627 } catch (ArgumentException) {
628 Assert ("P39#3", true);
633 public void TestDeepSkyBlue ()
635 Pen pen = Pens.DeepSkyBlue;
636 AssertEquals ("P40#1", pen.PenType, PenType.SolidColor);
637 AssertEquals ("P40#2", pen.Color, Color.DeepSkyBlue);
640 pen.Color = Color.DeepSkyBlue;
641 Fail ("P40#3: must throw ArgumentException");
642 } catch (ArgumentException) {
643 Assert ("P40#3", true);
648 public void TestDimGray ()
650 Pen pen = Pens.DimGray;
651 AssertEquals ("P41#1", pen.PenType, PenType.SolidColor);
652 AssertEquals ("P41#2", pen.Color, Color.DimGray);
655 pen.Color = Color.DimGray;
656 Fail ("P41#3: must throw ArgumentException");
657 } catch (ArgumentException) {
658 Assert ("P41#3", true);
663 public void TestDodgerBlue ()
665 Pen pen = Pens.DodgerBlue;
666 AssertEquals ("P42#1", pen.PenType, PenType.SolidColor);
667 AssertEquals ("P42#2", pen.Color, Color.DodgerBlue);
670 pen.Color = Color.DodgerBlue;
671 Fail ("P42#3: must throw ArgumentException");
672 } catch (ArgumentException) {
673 Assert ("P42#3", true);
678 public void TestFirebrick ()
680 Pen pen = Pens.Firebrick;
681 AssertEquals ("P43#1", pen.PenType, PenType.SolidColor);
682 AssertEquals ("P43#2", pen.Color, Color.Firebrick);
685 pen.Color = Color.Firebrick;
686 Fail ("P43#3: must throw ArgumentException");
687 } catch (ArgumentException) {
688 Assert ("P43#3", true);
693 public void TestFloralWhite ()
695 Pen pen = Pens.FloralWhite;
696 AssertEquals ("P44#1", pen.PenType, PenType.SolidColor);
697 AssertEquals ("P44#2", pen.Color, Color.FloralWhite);
700 pen.Color = Color.FloralWhite;
701 Fail ("P44#3: must throw ArgumentException");
702 } catch (ArgumentException) {
703 Assert ("P44#3", true);
708 public void TestForestGreen ()
710 Pen pen = Pens.ForestGreen;
711 AssertEquals ("P45#1", pen.PenType, PenType.SolidColor);
712 AssertEquals ("P45#2", pen.Color, Color.ForestGreen);
715 pen.Color = Color.ForestGreen;
716 Fail ("P45#3: must throw ArgumentException");
717 } catch (ArgumentException) {
718 Assert ("P45#3", true);
723 public void TestFuchsia ()
725 Pen pen = Pens.Fuchsia;
726 AssertEquals ("P46#1", pen.PenType, PenType.SolidColor);
727 AssertEquals ("P46#2", pen.Color, Color.Fuchsia);
730 pen.Color = Color.Fuchsia;
731 Fail ("P46#3: must throw ArgumentException");
732 } catch (ArgumentException) {
733 Assert ("P46#3", true);
738 public void TestGainsboro ()
740 Pen pen = Pens.Gainsboro;
741 AssertEquals ("P47#1", pen.PenType, PenType.SolidColor);
742 AssertEquals ("P47#2", pen.Color, Color.Gainsboro);
745 pen.Color = Color.Gainsboro;
746 Fail ("P47#3: must throw ArgumentException");
747 } catch (ArgumentException) {
748 Assert ("P47#3", true);
753 public void TestGhostWhite ()
755 Pen pen = Pens.GhostWhite;
756 AssertEquals ("P48#1", pen.PenType, PenType.SolidColor);
757 AssertEquals ("P48#2", pen.Color, Color.GhostWhite);
760 pen.Color = Color.GhostWhite;
761 Fail ("P48#3: must throw ArgumentException");
762 } catch (ArgumentException) {
763 Assert ("P48#3", true);
768 public void TestGold ()
771 AssertEquals ("P49#1", pen.PenType, PenType.SolidColor);
772 AssertEquals ("P49#2", pen.Color, Color.Gold);
775 pen.Color = Color.Gold;
776 Fail ("P49#3: must throw ArgumentException");
777 } catch (ArgumentException) {
778 Assert ("P49#3", true);
783 public void TestGoldenrod ()
785 Pen pen = Pens.Goldenrod;
786 AssertEquals ("P50#1", pen.PenType, PenType.SolidColor);
787 AssertEquals ("P50#2", pen.Color, Color.Goldenrod);
790 pen.Color = Color.Goldenrod;
791 Fail ("P50#3: must throw ArgumentException");
792 } catch (ArgumentException) {
793 Assert ("P50#3", true);
798 public void TestGray ()
801 AssertEquals ("P51#1", pen.PenType, PenType.SolidColor);
802 AssertEquals ("P51#2", pen.Color, Color.Gray);
805 pen.Color = Color.Gray;
806 Fail ("P51#3: must throw ArgumentException");
807 } catch (ArgumentException) {
808 Assert ("P51#3", true);
813 public void TestGreen ()
815 Pen pen = Pens.Green;
816 AssertEquals ("P52#1", pen.PenType, PenType.SolidColor);
817 AssertEquals ("P52#2", pen.Color, Color.Green);
820 pen.Color = Color.Green;
821 Fail ("P52#3: must throw ArgumentException");
822 } catch (ArgumentException) {
823 Assert ("P52#3", true);
828 public void TestGreenYellow ()
830 Pen pen = Pens.GreenYellow;
831 AssertEquals ("P53#1", pen.PenType, PenType.SolidColor);
832 AssertEquals ("P53#2", pen.Color, Color.GreenYellow);
835 pen.Color = Color.GreenYellow;
836 Fail ("P53#3: must throw ArgumentException");
837 } catch (ArgumentException) {
838 Assert ("P53#3", true);
843 public void TestHoneydew ()
845 Pen pen = Pens.Honeydew;
846 AssertEquals ("P54#1", pen.PenType, PenType.SolidColor);
847 AssertEquals ("P54#2", pen.Color, Color.Honeydew);
850 pen.Color = Color.Honeydew;
851 Fail ("P54#3: must throw ArgumentException");
852 } catch (ArgumentException) {
853 Assert ("P54#3", true);
858 public void TestHotPink ()
860 Pen pen = Pens.HotPink;
861 AssertEquals ("P55#1", pen.PenType, PenType.SolidColor);
862 AssertEquals ("P55#2", pen.Color, Color.HotPink);
865 pen.Color = Color.HotPink;
866 Fail ("P55#3: must throw ArgumentException");
867 } catch (ArgumentException) {
868 Assert ("P55#3", true);
873 public void TestIndianRed ()
875 Pen pen = Pens.IndianRed;
876 AssertEquals ("P56#1", pen.PenType, PenType.SolidColor);
877 AssertEquals ("P56#2", pen.Color, Color.IndianRed);
880 pen.Color = Color.IndianRed;
881 Fail ("P56#3: must throw ArgumentException");
882 } catch (ArgumentException) {
883 Assert ("P56#3", true);
888 public void TestIndigo ()
890 Pen pen = Pens.Indigo;
891 AssertEquals ("P57#1", pen.PenType, PenType.SolidColor);
892 AssertEquals ("P57#2", pen.Color, Color.Indigo);
895 pen.Color = Color.Indigo;
896 Fail ("P57#3: must throw ArgumentException");
897 } catch (ArgumentException) {
898 Assert ("P57#3", true);
903 public void TestIvory ()
905 Pen pen = Pens.Ivory;
906 AssertEquals ("P58#1", pen.PenType, PenType.SolidColor);
907 AssertEquals ("P58#2", pen.Color, Color.Ivory);
910 pen.Color = Color.Ivory;
911 Fail ("P58#3: must throw ArgumentException");
912 } catch (ArgumentException) {
913 Assert ("P58#3", true);
918 public void TestKhaki ()
920 Pen pen = Pens.Khaki;
921 AssertEquals ("P59#1", pen.PenType, PenType.SolidColor);
922 AssertEquals ("P59#2", pen.Color, Color.Khaki);
925 pen.Color = Color.Khaki;
926 Fail ("P59#3: must throw ArgumentException");
927 } catch (ArgumentException) {
928 Assert ("P59#3", true);
933 public void TestLavender ()
935 Pen pen = Pens.Lavender;
936 AssertEquals ("P60#1", pen.PenType, PenType.SolidColor);
937 AssertEquals ("P60#2", pen.Color, Color.Lavender);
940 pen.Color = Color.Lavender;
941 Fail ("P60#3: must throw ArgumentException");
942 } catch (ArgumentException) {
943 Assert ("P60#3", true);
948 public void TestLavenderBlush ()
950 Pen pen = Pens.LavenderBlush;
951 AssertEquals ("P61#1", pen.PenType, PenType.SolidColor);
952 AssertEquals ("P61#2", pen.Color, Color.LavenderBlush);
955 pen.Color = Color.LavenderBlush;
956 Fail ("P61#3: must throw ArgumentException");
957 } catch (ArgumentException) {
958 Assert ("P61#3", true);
963 public void TestLawnGreen ()
965 Pen pen = Pens.LawnGreen;
966 AssertEquals ("P62#1", pen.PenType, PenType.SolidColor);
967 AssertEquals ("P62#2", pen.Color, Color.LawnGreen);
970 pen.Color = Color.LawnGreen;
971 Fail ("P62#3: must throw ArgumentException");
972 } catch (ArgumentException) {
973 Assert ("P62#3", true);
978 public void TestLemonChiffon ()
980 Pen pen = Pens.LemonChiffon;
981 AssertEquals ("P63#1", pen.PenType, PenType.SolidColor);
982 AssertEquals ("P63#2", pen.Color, Color.LemonChiffon);
985 pen.Color = Color.LemonChiffon;
986 Fail ("P63#3: must throw ArgumentException");
987 } catch (ArgumentException) {
988 Assert ("P63#3", true);
993 public void TestLightBlue ()
995 Pen pen = Pens.LightBlue;
996 AssertEquals ("P64#1", pen.PenType, PenType.SolidColor);
997 AssertEquals ("P64#2", pen.Color, Color.LightBlue);
1000 pen.Color = Color.LightBlue;
1001 Fail ("P64#3: must throw ArgumentException");
1002 } catch (ArgumentException) {
1003 Assert ("P64#3", true);
1008 public void TestLightCoral ()
1010 Pen pen = Pens.LightCoral;
1011 AssertEquals ("P65#1", pen.PenType, PenType.SolidColor);
1012 AssertEquals ("P65#2", pen.Color, Color.LightCoral);
1015 pen.Color = Color.LightCoral;
1016 Fail ("P65#3: must throw ArgumentException");
1017 } catch (ArgumentException) {
1018 Assert ("P65#3", true);
1023 public void TestLightCyan ()
1025 Pen pen = Pens.LightCyan;
1026 AssertEquals ("P66#1", pen.PenType, PenType.SolidColor);
1027 AssertEquals ("P66#2", pen.Color, Color.LightCyan);
1030 pen.Color = Color.LightCyan;
1031 Fail ("P66#3: must throw ArgumentException");
1032 } catch (ArgumentException) {
1033 Assert ("P66#3", true);
1038 public void TestLightGoldenrodYellow ()
1040 Pen pen = Pens.LightGoldenrodYellow;
1041 AssertEquals ("P67#1", pen.PenType, PenType.SolidColor);
1042 AssertEquals ("P67#2", pen.Color, Color.LightGoldenrodYellow);
1045 pen.Color = Color.LightGoldenrodYellow;
1046 Fail ("P67#3: must throw ArgumentException");
1047 } catch (ArgumentException) {
1048 Assert ("P67#3", true);
1053 public void TestLightGray ()
1055 Pen pen = Pens.LightGray;
1056 AssertEquals ("P68#1", pen.PenType, PenType.SolidColor);
1057 AssertEquals ("P68#2", pen.Color, Color.LightGray);
1060 pen.Color = Color.LightGray;
1061 Fail ("P68#3: must throw ArgumentException");
1062 } catch (ArgumentException) {
1063 Assert ("P68#3", true);
1068 public void TestLightGreen ()
1070 Pen pen = Pens.LightGreen;
1071 AssertEquals ("P69#1", pen.PenType, PenType.SolidColor);
1072 AssertEquals ("P69#2", pen.Color, Color.LightGreen);
1075 pen.Color = Color.LightGreen;
1076 Fail ("P69#3: must throw ArgumentException");
1077 } catch (ArgumentException) {
1078 Assert ("P69#3", true);
1083 public void TestLightPink ()
1085 Pen pen = Pens.LightPink;
1086 AssertEquals ("P70#1", pen.PenType, PenType.SolidColor);
1087 AssertEquals ("P70#2", pen.Color, Color.LightPink);
1090 pen.Color = Color.LightPink;
1091 Fail ("P70#3: must throw ArgumentException");
1092 } catch (ArgumentException) {
1093 Assert ("P70#3", true);
1098 public void TestLightSalmon ()
1100 Pen pen = Pens.LightSalmon;
1101 AssertEquals ("P71#1", pen.PenType, PenType.SolidColor);
1102 AssertEquals ("P71#2", pen.Color, Color.LightSalmon);
1105 pen.Color = Color.LightSalmon;
1106 Fail ("P71#3: must throw ArgumentException");
1107 } catch (ArgumentException) {
1108 Assert ("P71#3", true);
1113 public void TestLightSeaGreen ()
1115 Pen pen = Pens.LightSeaGreen;
1116 AssertEquals ("P72#1", pen.PenType, PenType.SolidColor);
1117 AssertEquals ("P72#2", pen.Color, Color.LightSeaGreen);
1120 pen.Color = Color.LightSeaGreen;
1121 Fail ("P72#3: must throw ArgumentException");
1122 } catch (ArgumentException) {
1123 Assert ("P72#3", true);
1128 public void TestLightSkyBlue ()
1130 Pen pen = Pens.LightSkyBlue;
1131 AssertEquals ("P73#1", pen.PenType, PenType.SolidColor);
1132 AssertEquals ("P73#2", pen.Color, Color.LightSkyBlue);
1135 pen.Color = Color.LightSkyBlue;
1136 Fail ("P73#3: must throw ArgumentException");
1137 } catch (ArgumentException) {
1138 Assert ("P73#3", true);
1143 public void TestLightSlateGray ()
1145 Pen pen = Pens.LightSlateGray;
1146 AssertEquals ("P74#1", pen.PenType, PenType.SolidColor);
1147 AssertEquals ("P74#2", pen.Color, Color.LightSlateGray);
1150 pen.Color = Color.LightSlateGray;
1151 Fail ("P74#3: must throw ArgumentException");
1152 } catch (ArgumentException) {
1153 Assert ("P74#3", true);
1158 public void TestLightSteelBlue ()
1160 Pen pen = Pens.LightSteelBlue;
1161 AssertEquals ("P75#1", pen.PenType, PenType.SolidColor);
1162 AssertEquals ("P75#2", pen.Color, Color.LightSteelBlue);
1165 pen.Color = Color.LightSteelBlue;
1166 Fail ("P75#3: must throw ArgumentException");
1167 } catch (ArgumentException) {
1168 Assert ("P75#3", true);
1173 public void TestLightYellow ()
1175 Pen pen = Pens.LightYellow;
1176 AssertEquals ("P76#1", pen.PenType, PenType.SolidColor);
1177 AssertEquals ("P76#2", pen.Color, Color.LightYellow);
1180 pen.Color = Color.LightYellow;
1181 Fail ("P76#3: must throw ArgumentException");
1182 } catch (ArgumentException) {
1183 Assert ("P76#3", true);
1188 public void TestLime ()
1190 Pen pen = Pens.Lime;
1191 AssertEquals ("P77#1", pen.PenType, PenType.SolidColor);
1192 AssertEquals ("P77#2", pen.Color, Color.Lime);
1195 pen.Color = Color.Lime;
1196 Fail ("P77#3: must throw ArgumentException");
1197 } catch (ArgumentException) {
1198 Assert ("P77#3", true);
1203 public void TestLimeGreen ()
1205 Pen pen = Pens.LimeGreen;
1206 AssertEquals ("P78#1", pen.PenType, PenType.SolidColor);
1207 AssertEquals ("P78#2", pen.Color, Color.LimeGreen);
1210 pen.Color = Color.LimeGreen;
1211 Fail ("P78#3: must throw ArgumentException");
1212 } catch (ArgumentException) {
1213 Assert ("P78#3", true);
1218 public void TestLinen ()
1220 Pen pen = Pens.Linen;
1221 AssertEquals ("P79#1", pen.PenType, PenType.SolidColor);
1222 AssertEquals ("P79#2", pen.Color, Color.Linen);
1225 pen.Color = Color.Linen;
1226 Fail ("P79#3: must throw ArgumentException");
1227 } catch (ArgumentException) {
1228 Assert ("P79#3", true);
1233 public void TestMagenta ()
1235 Pen pen = Pens.Magenta;
1236 AssertEquals ("P80#1", pen.PenType, PenType.SolidColor);
1237 AssertEquals ("P80#2", pen.Color, Color.Magenta);
1240 pen.Color = Color.Magenta;
1241 Fail ("P80#3: must throw ArgumentException");
1242 } catch (ArgumentException) {
1243 Assert ("P80#3", true);
1248 public void TestMaroon ()
1250 Pen pen = Pens.Maroon;
1251 AssertEquals ("P81#1", pen.PenType, PenType.SolidColor);
1252 AssertEquals ("P81#2", pen.Color, Color.Maroon);
1255 pen.Color = Color.Maroon;
1256 Fail ("P81#3: must throw ArgumentException");
1257 } catch (ArgumentException) {
1258 Assert ("P81#3", true);
1263 public void TestMediumAquamarine ()
1265 Pen pen = Pens.MediumAquamarine;
1266 AssertEquals ("P82#1", pen.PenType, PenType.SolidColor);
1267 AssertEquals ("P82#2", pen.Color, Color.MediumAquamarine);
1270 pen.Color = Color.MediumAquamarine;
1271 Fail ("P82#3: must throw ArgumentException");
1272 } catch (ArgumentException) {
1273 Assert ("P82#3", true);
1278 public void TestMediumBlue ()
1280 Pen pen = Pens.MediumBlue;
1281 AssertEquals ("P83#1", pen.PenType, PenType.SolidColor);
1282 AssertEquals ("P83#2", pen.Color, Color.MediumBlue);
1285 pen.Color = Color.MediumBlue;
1286 Fail ("P83#3: must throw ArgumentException");
1287 } catch (ArgumentException) {
1288 Assert ("P83#3", true);
1293 public void TestMediumOrchid ()
1295 Pen pen = Pens.MediumOrchid;
1296 AssertEquals ("P84#1", pen.PenType, PenType.SolidColor);
1297 AssertEquals ("P84#2", pen.Color, Color.MediumOrchid);
1300 pen.Color = Color.MediumOrchid;
1301 Fail ("P84#3: must throw ArgumentException");
1302 } catch (ArgumentException) {
1303 Assert ("P84#3", true);
1308 public void TestMediumPurple ()
1310 Pen pen = Pens.MediumPurple;
1311 AssertEquals ("P85#1", pen.PenType, PenType.SolidColor);
1312 AssertEquals ("P85#2", pen.Color, Color.MediumPurple);
1315 pen.Color = Color.MediumPurple;
1316 Fail ("P85#3: must throw ArgumentException");
1317 } catch (ArgumentException) {
1318 Assert ("P85#3", true);
1323 public void TestMediumSeaGreen ()
1325 Pen pen = Pens.MediumSeaGreen;
1326 AssertEquals ("P86#1", pen.PenType, PenType.SolidColor);
1327 AssertEquals ("P86#2", pen.Color, Color.MediumSeaGreen);
1330 pen.Color = Color.MediumSeaGreen;
1331 Fail ("P86#3: must throw ArgumentException");
1332 } catch (ArgumentException) {
1333 Assert ("P86#3", true);
1338 public void TestMediumSlateBlue ()
1340 Pen pen = Pens.MediumSlateBlue;
1341 AssertEquals ("P87#1", pen.PenType, PenType.SolidColor);
1342 AssertEquals ("P87#2", pen.Color, Color.MediumSlateBlue);
1345 pen.Color = Color.MediumSlateBlue;
1346 Fail ("P87#3: must throw ArgumentException");
1347 } catch (ArgumentException) {
1348 Assert ("P87#3", true);
1353 public void TestMediumSpringGreen ()
1355 Pen pen = Pens.MediumSpringGreen;
1356 AssertEquals ("P88#1", pen.PenType, PenType.SolidColor);
1357 AssertEquals ("P88#2", pen.Color, Color.MediumSpringGreen);
1360 pen.Color = Color.MediumSpringGreen;
1361 Fail ("P88#3: must throw ArgumentException");
1362 } catch (ArgumentException) {
1363 Assert ("P88#3", true);
1368 public void TestMediumTurquoise ()
1370 Pen pen = Pens.MediumTurquoise;
1371 AssertEquals ("P89#1", pen.PenType, PenType.SolidColor);
1372 AssertEquals ("P89#2", pen.Color, Color.MediumTurquoise);
1375 pen.Color = Color.MediumTurquoise;
1376 Fail ("P89#3: must throw ArgumentException");
1377 } catch (ArgumentException) {
1378 Assert ("P89#3", true);
1383 public void TestMediumVioletRed ()
1385 Pen pen = Pens.MediumVioletRed;
1386 AssertEquals ("P90#1", pen.PenType, PenType.SolidColor);
1387 AssertEquals ("P90#2", pen.Color, Color.MediumVioletRed);
1390 pen.Color = Color.MediumVioletRed;
1391 Fail ("P90#3: must throw ArgumentException");
1392 } catch (ArgumentException) {
1393 Assert ("P90#3", true);
1398 public void TestMidnightBlue ()
1400 Pen pen = Pens.MidnightBlue;
1401 AssertEquals ("P91#1", pen.PenType, PenType.SolidColor);
1402 AssertEquals ("P91#2", pen.Color, Color.MidnightBlue);
1405 pen.Color = Color.MidnightBlue;
1406 Fail ("P91#3: must throw ArgumentException");
1407 } catch (ArgumentException) {
1408 Assert ("P91#3", true);
1413 public void TestMintCream ()
1415 Pen pen = Pens.MintCream;
1416 AssertEquals ("P92#1", pen.PenType, PenType.SolidColor);
1417 AssertEquals ("P92#2", pen.Color, Color.MintCream);
1420 pen.Color = Color.MintCream;
1421 Fail ("P92#3: must throw ArgumentException");
1422 } catch (ArgumentException) {
1423 Assert ("P92#3", true);
1428 public void TestMistyRose ()
1430 Pen pen = Pens.MistyRose;
1431 AssertEquals ("P93#1", pen.PenType, PenType.SolidColor);
1432 AssertEquals ("P93#2", pen.Color, Color.MistyRose);
1435 pen.Color = Color.MistyRose;
1436 Fail ("P93#3: must throw ArgumentException");
1437 } catch (ArgumentException) {
1438 Assert ("P93#3", true);
1443 public void TestMoccasin ()
1445 Pen pen = Pens.Moccasin;
1446 AssertEquals ("P94#1", pen.PenType, PenType.SolidColor);
1447 AssertEquals ("P94#2", pen.Color, Color.Moccasin);
1450 pen.Color = Color.Moccasin;
1451 Fail ("P94#3: must throw ArgumentException");
1452 } catch (ArgumentException) {
1453 Assert ("P94#3", true);
1458 public void TestNavajoWhite ()
1460 Pen pen = Pens.NavajoWhite;
1461 AssertEquals ("P95#1", pen.PenType, PenType.SolidColor);
1462 AssertEquals ("P95#2", pen.Color, Color.NavajoWhite);
1465 pen.Color = Color.NavajoWhite;
1466 Fail ("P95#3: must throw ArgumentException");
1467 } catch (ArgumentException) {
1468 Assert ("P95#3", true);
1473 public void TestNavy ()
1475 Pen pen = Pens.Navy;
1476 AssertEquals ("P96#1", pen.PenType, PenType.SolidColor);
1477 AssertEquals ("P96#2", pen.Color, Color.Navy);
1480 pen.Color = Color.Navy;
1481 Fail ("P96#3: must throw ArgumentException");
1482 } catch (ArgumentException) {
1483 Assert ("P96#3", true);
1488 public void TestOldLace ()
1490 Pen pen = Pens.OldLace;
1491 AssertEquals ("P97#1", pen.PenType, PenType.SolidColor);
1492 AssertEquals ("P97#2", pen.Color, Color.OldLace);
1495 pen.Color = Color.OldLace;
1496 Fail ("P97#3: must throw ArgumentException");
1497 } catch (ArgumentException) {
1498 Assert ("P97#3", true);
1503 public void TestOlive ()
1505 Pen pen = Pens.Olive;
1506 AssertEquals ("P98#1", pen.PenType, PenType.SolidColor);
1507 AssertEquals ("P98#2", pen.Color, Color.Olive);
1510 pen.Color = Color.Olive;
1511 Fail ("P98#3: must throw ArgumentException");
1512 } catch (ArgumentException) {
1513 Assert ("P98#3", true);
1518 public void TestOliveDrab ()
1520 Pen pen = Pens.OliveDrab;
1521 AssertEquals ("P99#1", pen.PenType, PenType.SolidColor);
1522 AssertEquals ("P99#2", pen.Color, Color.OliveDrab);
1525 pen.Color = Color.OliveDrab;
1526 Fail ("P99#3: must throw ArgumentException");
1527 } catch (ArgumentException) {
1528 Assert ("P99#3", true);
1533 public void TestOrange ()
1535 Pen pen = Pens.Orange;
1536 AssertEquals ("P100#1", pen.PenType, PenType.SolidColor);
1537 AssertEquals ("P100#2", pen.Color, Color.Orange);
1540 pen.Color = Color.Orange;
1541 Fail ("P100#3: must throw ArgumentException");
1542 } catch (ArgumentException) {
1543 Assert ("P100#3", true);
1548 public void TestOrangeRed ()
1550 Pen pen = Pens.OrangeRed;
1551 AssertEquals ("P101#1", pen.PenType, PenType.SolidColor);
1552 AssertEquals ("P101#2", pen.Color, Color.OrangeRed);
1555 pen.Color = Color.OrangeRed;
1556 Fail ("P101#3: must throw ArgumentException");
1557 } catch (ArgumentException) {
1558 Assert ("P101#3", true);
1563 public void TestOrchid ()
1565 Pen pen = Pens.Orchid;
1566 AssertEquals ("P102#1", pen.PenType, PenType.SolidColor);
1567 AssertEquals ("P102#2", pen.Color, Color.Orchid);
1570 pen.Color = Color.Orchid;
1571 Fail ("P102#3: must throw ArgumentException");
1572 } catch (ArgumentException) {
1573 Assert ("P102#3", true);
1578 public void TestPaleGoldenrod ()
1580 Pen pen = Pens.PaleGoldenrod;
1581 AssertEquals ("P103#1", pen.PenType, PenType.SolidColor);
1582 AssertEquals ("P103#2", pen.Color, Color.PaleGoldenrod);
1585 pen.Color = Color.PaleGoldenrod;
1586 Fail ("P103#3: must throw ArgumentException");
1587 } catch (ArgumentException) {
1588 Assert ("P103#3", true);
1593 public void TestPaleGreen ()
1595 Pen pen = Pens.PaleGreen;
1596 AssertEquals ("P104#1", pen.PenType, PenType.SolidColor);
1597 AssertEquals ("P104#2", pen.Color, Color.PaleGreen);
1600 pen.Color = Color.PaleGreen;
1601 Fail ("P104#3: must throw ArgumentException");
1602 } catch (ArgumentException) {
1603 Assert ("P104#3", true);
1608 public void TestPaleTurquoise ()
1610 Pen pen = Pens.PaleTurquoise;
1611 AssertEquals ("P105#1", pen.PenType, PenType.SolidColor);
1612 AssertEquals ("P105#2", pen.Color, Color.PaleTurquoise);
1615 pen.Color = Color.PaleTurquoise;
1616 Fail ("P105#3: must throw ArgumentException");
1617 } catch (ArgumentException) {
1618 Assert ("P105#3", true);
1623 public void TestPaleVioletRed ()
1625 Pen pen = Pens.PaleVioletRed;
1626 AssertEquals ("P106#1", pen.PenType, PenType.SolidColor);
1627 AssertEquals ("P106#2", pen.Color, Color.PaleVioletRed);
1630 pen.Color = Color.PaleVioletRed;
1631 Fail ("P106#3: must throw ArgumentException");
1632 } catch (ArgumentException) {
1633 Assert ("P106#3", true);
1638 public void TestPapayaWhip ()
1640 Pen pen = Pens.PapayaWhip;
1641 AssertEquals ("P107#1", pen.PenType, PenType.SolidColor);
1642 AssertEquals ("P107#2", pen.Color, Color.PapayaWhip);
1645 pen.Color = Color.PapayaWhip;
1646 Fail ("P107#3: must throw ArgumentException");
1647 } catch (ArgumentException) {
1648 Assert ("P107#3", true);
1653 public void TestPeachPuff ()
1655 Pen pen = Pens.PeachPuff;
1656 AssertEquals ("P108#1", pen.PenType, PenType.SolidColor);
1657 AssertEquals ("P108#2", pen.Color, Color.PeachPuff);
1660 pen.Color = Color.PeachPuff;
1661 Fail ("P108#3: must throw ArgumentException");
1662 } catch (ArgumentException) {
1663 Assert ("P108#3", true);
1668 public void TestPeru ()
1670 Pen pen = Pens.Peru;
1671 AssertEquals ("P109#1", pen.PenType, PenType.SolidColor);
1672 AssertEquals ("P109#2", pen.Color, Color.Peru);
1675 pen.Color = Color.Peru;
1676 Fail ("P109#3: must throw ArgumentException");
1677 } catch (ArgumentException) {
1678 Assert ("P109#3", true);
1683 public void TestPink ()
1685 Pen pen = Pens.Pink;
1686 AssertEquals ("P110#1", pen.PenType, PenType.SolidColor);
1687 AssertEquals ("P110#2", pen.Color, Color.Pink);
1690 pen.Color = Color.Pink;
1691 Fail ("P110#3: must throw ArgumentException");
1692 } catch (ArgumentException) {
1693 Assert ("P110#3", true);
1698 public void TestPlum ()
1700 Pen pen = Pens.Plum;
1701 AssertEquals ("P111#1", pen.PenType, PenType.SolidColor);
1702 AssertEquals ("P111#2", pen.Color, Color.Plum);
1705 pen.Color = Color.Plum;
1706 Fail ("P111#3: must throw ArgumentException");
1707 } catch (ArgumentException) {
1708 Assert ("P111#3", true);
1713 public void TestPowderBlue ()
1715 Pen pen = Pens.PowderBlue;
1716 AssertEquals ("P112#1", pen.PenType, PenType.SolidColor);
1717 AssertEquals ("P112#2", pen.Color, Color.PowderBlue);
1720 pen.Color = Color.PowderBlue;
1721 Fail ("P112#3: must throw ArgumentException");
1722 } catch (ArgumentException) {
1723 Assert ("P112#3", true);
1728 public void TestPurple ()
1730 Pen pen = Pens.Purple;
1731 AssertEquals ("P113#1", pen.PenType, PenType.SolidColor);
1732 AssertEquals ("P113#2", pen.Color, Color.Purple);
1735 pen.Color = Color.Purple;
1736 Fail ("P113#3: must throw ArgumentException");
1737 } catch (ArgumentException) {
1738 Assert ("P113#3", true);
1743 public void TestRed ()
1746 AssertEquals ("P114#1", pen.PenType, PenType.SolidColor);
1747 AssertEquals ("P114#2", pen.Color, Color.Red);
1750 pen.Color = Color.Red;
1751 Fail ("P114#3: must throw ArgumentException");
1752 } catch (ArgumentException) {
1753 Assert ("P114#3", true);
1758 public void TestRosyBrown ()
1760 Pen pen = Pens.RosyBrown;
1761 AssertEquals ("P115#1", pen.PenType, PenType.SolidColor);
1762 AssertEquals ("P115#2", pen.Color, Color.RosyBrown);
1765 pen.Color = Color.RosyBrown;
1766 Fail ("P115#3: must throw ArgumentException");
1767 } catch (ArgumentException) {
1768 Assert ("P115#3", true);
1773 public void TestRoyalBlue ()
1775 Pen pen = Pens.RoyalBlue;
1776 AssertEquals ("P116#1", pen.PenType, PenType.SolidColor);
1777 AssertEquals ("P116#2", pen.Color, Color.RoyalBlue);
1780 pen.Color = Color.RoyalBlue;
1781 Fail ("P116#3: must throw ArgumentException");
1782 } catch (ArgumentException) {
1783 Assert ("P116#3", true);
1788 public void TestSaddleBrown ()
1790 Pen pen = Pens.SaddleBrown;
1791 AssertEquals ("P117#1", pen.PenType, PenType.SolidColor);
1792 AssertEquals ("P117#2", pen.Color, Color.SaddleBrown);
1795 pen.Color = Color.SaddleBrown;
1796 Fail ("P117#3: must throw ArgumentException");
1797 } catch (ArgumentException) {
1798 Assert ("P117#3", true);
1803 public void TestSalmon ()
1805 Pen pen = Pens.Salmon;
1806 AssertEquals ("P118#1", pen.PenType, PenType.SolidColor);
1807 AssertEquals ("P118#2", pen.Color, Color.Salmon);
1810 pen.Color = Color.Salmon;
1811 Fail ("P118#3: must throw ArgumentException");
1812 } catch (ArgumentException) {
1813 Assert ("P118#3", true);
1818 public void TestSandyBrown ()
1820 Pen pen = Pens.SandyBrown;
1821 AssertEquals ("P119#1", pen.PenType, PenType.SolidColor);
1822 AssertEquals ("P119#2", pen.Color, Color.SandyBrown);
1825 pen.Color = Color.SandyBrown;
1826 Fail ("P119#3: must throw ArgumentException");
1827 } catch (ArgumentException) {
1828 Assert ("P119#3", true);
1833 public void TestSeaGreen ()
1835 Pen pen = Pens.SeaGreen;
1836 AssertEquals ("P120#1", pen.PenType, PenType.SolidColor);
1837 AssertEquals ("P120#2", pen.Color, Color.SeaGreen);
1840 pen.Color = Color.SeaGreen;
1841 Fail ("P120#3: must throw ArgumentException");
1842 } catch (ArgumentException) {
1843 Assert ("P120#3", true);
1848 public void TestSeaShell ()
1850 Pen pen = Pens.SeaShell;
1851 AssertEquals ("P121#1", pen.PenType, PenType.SolidColor);
1852 AssertEquals ("P121#2", pen.Color, Color.SeaShell);
1855 pen.Color = Color.SeaShell;
1856 Fail ("P121#3: must throw ArgumentException");
1857 } catch (ArgumentException) {
1858 Assert ("P121#3", true);
1863 public void TestSienna ()
1865 Pen pen = Pens.Sienna;
1866 AssertEquals ("P122#1", pen.PenType, PenType.SolidColor);
1867 AssertEquals ("P122#2", pen.Color, Color.Sienna);
1870 pen.Color = Color.Sienna;
1871 Fail ("P122#3: must throw ArgumentException");
1872 } catch (ArgumentException) {
1873 Assert ("P122#3", true);
1878 public void TestSilver ()
1880 Pen pen = Pens.Silver;
1881 AssertEquals ("P123#1", pen.PenType, PenType.SolidColor);
1882 AssertEquals ("P123#2", pen.Color, Color.Silver);
1885 pen.Color = Color.Silver;
1886 Fail ("P123#3: must throw ArgumentException");
1887 } catch (ArgumentException) {
1888 Assert ("P123#3", true);
1893 public void TestSkyBlue ()
1895 Pen pen = Pens.SkyBlue;
1896 AssertEquals ("P124#1", pen.PenType, PenType.SolidColor);
1897 AssertEquals ("P124#2", pen.Color, Color.SkyBlue);
1900 pen.Color = Color.SkyBlue;
1901 Fail ("P124#3: must throw ArgumentException");
1902 } catch (ArgumentException) {
1903 Assert ("P124#3", true);
1908 public void TestSlateBlue ()
1910 Pen pen = Pens.SlateBlue;
1911 AssertEquals ("P125#1", pen.PenType, PenType.SolidColor);
1912 AssertEquals ("P125#2", pen.Color, Color.SlateBlue);
1915 pen.Color = Color.SlateBlue;
1916 Fail ("P125#3: must throw ArgumentException");
1917 } catch (ArgumentException) {
1918 Assert ("P125#3", true);
1923 public void TestSlateGray ()
1925 Pen pen = Pens.SlateGray;
1926 AssertEquals ("P126#1", pen.PenType, PenType.SolidColor);
1927 AssertEquals ("P126#2", pen.Color, Color.SlateGray);
1930 pen.Color = Color.SlateGray;
1931 Fail ("P126#3: must throw ArgumentException");
1932 } catch (ArgumentException) {
1933 Assert ("P126#3", true);
1938 public void TestSnow ()
1940 Pen pen = Pens.Snow;
1941 AssertEquals ("P127#1", pen.PenType, PenType.SolidColor);
1942 AssertEquals ("P127#2", pen.Color, Color.Snow);
1945 pen.Color = Color.Snow;
1946 Fail ("P127#3: must throw ArgumentException");
1947 } catch (ArgumentException) {
1948 Assert ("P127#3", true);
1953 public void TestSpringGreen ()
1955 Pen pen = Pens.SpringGreen;
1956 AssertEquals ("P128#1", pen.PenType, PenType.SolidColor);
1957 AssertEquals ("P128#2", pen.Color, Color.SpringGreen);
1960 pen.Color = Color.SpringGreen;
1961 Fail ("P128#3: must throw ArgumentException");
1962 } catch (ArgumentException) {
1963 Assert ("P128#3", true);
1968 public void TestSteelBlue ()
1970 Pen pen = Pens.SteelBlue;
1971 AssertEquals ("P129#1", pen.PenType, PenType.SolidColor);
1972 AssertEquals ("P129#2", pen.Color, Color.SteelBlue);
1975 pen.Color = Color.SteelBlue;
1976 Fail ("P129#3: must throw ArgumentException");
1977 } catch (ArgumentException) {
1978 Assert ("P129#3", true);
1983 public void TestTan ()
1986 AssertEquals ("P130#1", pen.PenType, PenType.SolidColor);
1987 AssertEquals ("P130#2", pen.Color, Color.Tan);
1990 pen.Color = Color.Tan;
1991 Fail ("P130#3: must throw ArgumentException");
1992 } catch (ArgumentException) {
1993 Assert ("P130#3", true);
1998 public void TestTeal ()
2000 Pen pen = Pens.Teal;
2001 AssertEquals ("P131#1", pen.PenType, PenType.SolidColor);
2002 AssertEquals ("P131#2", pen.Color, Color.Teal);
2005 pen.Color = Color.Teal;
2006 Fail ("P131#3: must throw ArgumentException");
2007 } catch (ArgumentException) {
2008 Assert ("P131#3", true);
2013 public void TestThistle ()
2015 Pen pen = Pens.Thistle;
2016 AssertEquals ("P132#1", pen.PenType, PenType.SolidColor);
2017 AssertEquals ("P132#2", pen.Color, Color.Thistle);
2020 pen.Color = Color.Thistle;
2021 Fail ("P132#3: must throw ArgumentException");
2022 } catch (ArgumentException) {
2023 Assert ("P132#3", true);
2028 public void TestTomato ()
2030 Pen pen = Pens.Tomato;
2031 AssertEquals ("P133#1", pen.PenType, PenType.SolidColor);
2032 AssertEquals ("P133#2", pen.Color, Color.Tomato);
2035 pen.Color = Color.Tomato;
2036 Fail ("P133#3: must throw ArgumentException");
2037 } catch (ArgumentException) {
2038 Assert ("P133#3", true);
2043 public void TestTransparent ()
2045 Pen pen = Pens.Transparent;
2046 AssertEquals ("P134#1", pen.PenType, PenType.SolidColor);
2047 AssertEquals ("P134#2", pen.Color, Color.Transparent);
2050 pen.Color = Color.Transparent;
2051 Fail ("P134#3: must throw ArgumentException");
2052 } catch (ArgumentException) {
2053 Assert ("P134#3", true);
2058 public void TestTurquoise ()
2060 Pen pen = Pens.Turquoise;
2061 AssertEquals ("P135#1", pen.PenType, PenType.SolidColor);
2062 AssertEquals ("P135#2", pen.Color, Color.Turquoise);
2065 pen.Color = Color.Turquoise;
2066 Fail ("P135#3: must throw ArgumentException");
2067 } catch (ArgumentException) {
2068 Assert ("P135#3", true);
2073 public void TestViolet ()
2075 Pen pen = Pens.Violet;
2076 AssertEquals ("P136#1", pen.PenType, PenType.SolidColor);
2077 AssertEquals ("P136#2", pen.Color, Color.Violet);
2080 pen.Color = Color.Violet;
2081 Fail ("P136#3: must throw ArgumentException");
2082 } catch (ArgumentException) {
2083 Assert ("P136#3", true);
2088 public void TestWheat ()
2090 Pen pen = Pens.Wheat;
2091 AssertEquals ("P137#1", pen.PenType, PenType.SolidColor);
2092 AssertEquals ("P137#2", pen.Color, Color.Wheat);
2095 pen.Color = Color.Wheat;
2096 Fail ("P137#3: must throw ArgumentException");
2097 } catch (ArgumentException) {
2098 Assert ("P137#3", true);
2103 public void TestWhite ()
2105 Pen pen = Pens.White;
2106 AssertEquals ("P138#1", pen.PenType, PenType.SolidColor);
2107 AssertEquals ("P138#2", pen.Color, Color.White);
2110 pen.Color = Color.White;
2111 Fail ("P138#3: must throw ArgumentException");
2112 } catch (ArgumentException) {
2113 Assert ("P138#3", true);
2118 public void TestWhiteSmoke ()
2120 Pen pen = Pens.WhiteSmoke;
2121 AssertEquals ("P139#1", pen.PenType, PenType.SolidColor);
2122 AssertEquals ("P139#2", pen.Color, Color.WhiteSmoke);
2125 pen.Color = Color.WhiteSmoke;
2126 Fail ("P139#3: must throw ArgumentException");
2127 } catch (ArgumentException) {
2128 Assert ("P139#3", true);
2133 public void TestYellow ()
2135 Pen pen = Pens.Yellow;
2136 AssertEquals ("P140#1", pen.PenType, PenType.SolidColor);
2137 AssertEquals ("P140#2", pen.Color, Color.Yellow);
2140 pen.Color = Color.Yellow;
2141 Fail ("P140#3: must throw ArgumentException");
2142 } catch (ArgumentException) {
2143 Assert ("P140#3", true);
2148 public void TestYellowGreen ()
2150 Pen pen = Pens.YellowGreen;
2151 AssertEquals ("P141#1", pen.PenType, PenType.SolidColor);
2152 AssertEquals ("P141#2", pen.Color, Color.YellowGreen);
2155 pen.Color = Color.YellowGreen;
2156 Fail ("P141#3: must throw ArgumentException");
2157 } catch (ArgumentException) {
2158 Assert ("P141#3", true);
2164 // Following code was used to generate the test methods above
2166 //Type type = typeof (Pens);
2167 //PropertyInfo [] properties = type.GetProperties ();
2169 //foreach (PropertyInfo property in properties) {
2170 // Console.WriteLine();
2171 // Console.WriteLine("\t\t[Test]");
2172 // Console.WriteLine("\t\tpublic void Test" + property.Name + " ()");
2173 // Console.WriteLine("\t\t{");
2174 // Console.WriteLine("\t\t\tPen pen = Pens." + property.Name + ";");
2175 // Console.WriteLine("\t\t\tAssertEquals (\"P" + count + "#1\", pen.PenType, PenType.SolidColor);");
2176 // Console.WriteLine("\t\t\tAssertEquals (\"P" + count + "#2\", pen.Color, Color." + property.Name + ");\n");
2178 // Console.WriteLine("\t\t\ttry {");
2179 // Console.WriteLine("\t\t\t\tpen.Color = Color." + property.Name + ";");
2180 // Console.WriteLine("\t\t\t\tFail (\"P" + count + "#3: must throw ArgumentException\");");
2181 // Console.WriteLine("\t\t\t} catch (ArgumentException) {");
2182 // Console.WriteLine("\t\t\t\tAssert (\"P" + count + "#3\", true);");
2183 // Console.WriteLine("\t\t\t}");
2184 // Console.WriteLine("\t\t}");