2 using System.Drawing;
\r
3 using System.Drawing.Drawing2D;
\r
4 using NUnit.Framework;
\r
5 using DrawingTestHelper;
\r
7 namespace Test.Sys.Drawing
\r
10 /// Summary description for Pen.
\r
13 public class PenFixture {
\r
14 //TODO: Brush, CompoundArray, CustomEndCap, CustomStartCap,
\r
15 //StartCap, EndCap, PenType, Transform
\r
18 protected int TOLERANCE = 3;
\r
22 public void SetUp () {
\r
23 t = DrawingTest.Create (256, 256);
\r
24 p = new Pen (Color.Blue);
\r
26 DrawingTest.ShowForms = false;
\r
30 public void TearDown ()
\r
36 #region InitAlignment
\r
38 public void InitAlignment () {
\r
39 Pen p = new Pen (Color.Blue);
\r
40 Assert.AreEqual (PenAlignment.Center, p.Alignment);
\r
46 public void PenWidth_1()
\r
48 Assert.AreEqual(10, p.Width);
\r
49 t.Graphics.DrawLine (p, 20, 200, 200, 20);
\r
51 Assert.IsTrue (t.Compare (TOLERANCE * 1.5f)); //FIXME: Pen width in GH is not the same as in .NET
\r
54 public void PenWidth_2()
\r
57 t.Graphics.DrawLine (p, 20, 200, 200, 20);
\r
59 Assert.IsTrue (t.Compare (TOLERANCE));
\r
62 public void PenWidth_3 ()
\r
64 t.Graphics.DrawLine (p, 10, 100, 200, 100);
\r
66 Assert.IsTrue (t.Compare (TOLERANCE));
\r
70 #region DashStyle Tests
\r
72 public void DashStyleTest_1 ()
\r
74 Assert.AreEqual (DashStyle.Solid, p.DashStyle);
\r
76 t.Graphics.DrawLine (p, 20, 100, 230, 100);
\r
78 Assert.IsTrue (t.Compare (TOLERANCE));
\r
81 public void DashStyleTest_2 () {
\r
82 p.DashStyle = DashStyle.Dash;
\r
84 t.Graphics.DrawLine (p, 20, 100, 230, 100);
\r
86 Assert.IsTrue (t.Compare (TOLERANCE));
\r
89 public void DashStyleTest_3 () {
\r
90 p.DashStyle = DashStyle.DashDot;
\r
92 t.Graphics.FillRectangle (Brushes.Black, 0, 0, 256, 256);
\r
93 t.Graphics.DrawLine (p, 20, 100, 230, 100);
\r
95 Assert.IsTrue (t.Compare (TOLERANCE));
\r
98 public void DashStyleTest_4 () {
\r
99 p.DashStyle = DashStyle.DashDotDot;
\r
101 t.Graphics.FillRectangle (Brushes.Black, 0, 0, 256, 256);
\r
102 t.Graphics.DrawLine (p, 20, 100, 230, 100);
\r
104 Assert.IsTrue (t.Compare (TOLERANCE));
\r
107 public void DashStyleTest_5 () {
\r
108 p.DashStyle = DashStyle.Dot;
\r
110 t.Graphics.FillRectangle (Brushes.Black, 0, 0, 256, 256);
\r
111 t.Graphics.DrawLine (p, 20, 100, 230, 100);
\r
113 Assert.IsTrue (t.Compare (TOLERANCE));
\r
116 public void DashStyleTest_6 () {
\r
117 p.DashStyle = DashStyle.Custom;
\r
119 t.Graphics.FillRectangle (Brushes.Black, 0, 0, 256, 256);
\r
120 t.Graphics.DrawLine (p, 20, 100, 230, 100);
\r
122 Assert.IsTrue (t.Compare (TOLERANCE));
\r
126 #region DashCustomStyle
\r
127 //The following tests DashOffset and DashPattern
\r
129 [Category ("NotWorking")]
\r
130 public void DashCustomStyle_1 () {
\r
131 p.DashStyle = DashStyle.Custom;
\r
133 Assert.AreEqual (new float [] {1F}, p.DashPattern);
\r
134 Assert.AreEqual (0F, p.DashOffset);
\r
137 public void DashCustomStyle_2 () {
\r
138 p.DashPattern = new float [] {2, 3, 1.15F, 0.05F};
\r
139 t.Graphics.FillRectangle (Brushes.Black, 0, 0, 256, 256);
\r
140 t.Graphics.DrawLine (p, 20, 100, 200, 100);
\r
142 Assert.IsTrue (t.Compare (TOLERANCE));
\r
145 public void DashCustomStyle_3 () {
\r
146 p.DashOffset = 10F;
\r
147 t.Graphics.DrawLine (p, 20, 100, 200, 100);
\r
149 Assert.IsTrue (t.Compare (TOLERANCE));
\r
152 [Category ("NotWorking")]
\r
153 public void DashCustomStyle_4 () {
\r
154 p.DashPattern = new float [] {2, 3, 1.15F, 0.05F, 1.74321F};
\r
155 p.DashOffset = 10.2F;
\r
156 t.Graphics.DrawLine (p, 20, 100, 200, 100);
\r
158 Assert.IsTrue (t.Compare (TOLERANCE));
\r
161 [Category ("NotWorking")]
\r
162 public void DashCustomStyle_5 () {
\r
163 p.DashPattern = new float [] {2, 3, 1.15F, 0.05F, 1.74321F};
\r
164 p.DashOffset = 10.2F;
\r
165 t.Graphics.DrawLine (p, 20, 100, 200, 100);
\r
167 Assert.IsTrue (t.Compare (TOLERANCE));
\r
171 #region DashCapTest
\r
173 public void DashCapTest_Flat () {
\r
175 Assert.AreEqual (DashCap.Flat, p.DashCap);
\r
176 p.DashStyle = DashStyle.DashDot;
\r
177 t.Graphics.DrawLine (p, 10, 100, 230, 100);
\r
179 Assert.IsTrue (t.Compare (TOLERANCE));
\r
182 [Category ("NotWorking")]
\r
183 public void DashCapTest_Round () {
\r
185 p.DashStyle = DashStyle.DashDot;
\r
186 p.DashCap = DashCap.Round;
\r
187 t.Graphics.DrawLine (p, 10, 100, 230, 100);
\r
189 Assert.IsTrue (t.Compare (TOLERANCE));
\r
192 [Category ("NotWorking")]
\r
193 public void DashCapTest_Triangle () {
\r
195 p.DashStyle = DashStyle.DashDot;
\r
196 p.DashCap = DashCap.Triangle;
\r
197 t.Graphics.DrawLine (p, 10, 100, 230, 100);
\r
199 Assert.IsTrue (t.Compare (TOLERANCE));
\r
203 #region LineJoin Round
\r
205 public void LineJoinTest_Round_1 () {
\r
206 Point [] points = new Point [] {
\r
207 new Point(100, 210), new Point (120, 50),
\r
208 new Point (140, 210)};
\r
210 p.LineJoin = LineJoin.Round;
\r
211 t.Graphics.DrawPolygon (p, points);
\r
212 t.Graphics.DrawPolygon (Pens.White, points);
\r
214 Assert.IsTrue (t.Compare (TOLERANCE));
\r
218 public void LineJoinTest_Round_2 () {
\r
219 Point [] points = new Point [] {
\r
220 new Point(50, 210), new Point (120, 50),
\r
221 new Point (190, 210)};
\r
223 p.LineJoin = LineJoin.Round;
\r
224 t.Graphics.DrawPolygon (p, points);
\r
225 t.Graphics.DrawPolygon (Pens.White, points);
\r
227 Assert.IsTrue (t.Compare (TOLERANCE));
\r
231 #region LineJoin Miter
\r
233 public void LineJoinTest_Miter_1 () {
\r
234 p.LineJoin = LineJoin.Miter;
\r
235 Point [] points = new Point [] {
\r
236 new Point(100, 217), new Point (130, 100),
\r
237 new Point (160, 217)};
\r
239 t.Graphics.DrawLines (p, points);
\r
240 t.Graphics.DrawLines (Pens.White, points);
\r
242 Assert.IsTrue (t.Compare (TOLERANCE));
\r
245 [Category ("NotWorking")]
\r
246 public void LineJoinTest_Miter_2 () {
\r
247 p.LineJoin = LineJoin.Miter;
\r
248 Point [] points = new Point [] {
\r
249 new Point(120, 237), new Point (130, 100),
\r
250 new Point (140, 237)};
\r
252 t.Graphics.DrawLines (p, points);
\r
253 t.Graphics.DrawLines (Pens.White, points);
\r
255 Assert.IsTrue (t.Compare (TOLERANCE));
\r
258 public void LineJoinTest_Miter_3 () {
\r
259 p.LineJoin = LineJoin.Miter;
\r
260 Point [] points = new Point [] {
\r
261 new Point(50, 217), new Point (100, 100),
\r
262 new Point (150, 217)};
\r
264 t.Graphics.DrawLines (p, points);
\r
265 t.Graphics.DrawLines (Pens.White, points);
\r
267 Assert.IsTrue (t.Compare (TOLERANCE));
\r
271 #region LineJoin MiterClipped
\r
273 public void LineJoinTest_MiterClipped_1 () {
\r
274 p.LineJoin = LineJoin.MiterClipped;
\r
275 Point [] points = new Point [] {
\r
276 new Point(100, 217), new Point (130, 100),
\r
277 new Point (160, 217)};
\r
279 t.Graphics.DrawLines (p, points);
\r
280 t.Graphics.DrawLines (Pens.White, points);
\r
282 Assert.IsTrue (t.Compare (TOLERANCE));
\r
285 public void LineJoinTest_MiterClipped_2 () {
\r
286 p.LineJoin = LineJoin.MiterClipped;
\r
287 Point [] points = new Point [] {
\r
288 new Point(120, 217), new Point (130, 80),
\r
289 new Point (140, 217)};
\r
291 t.Graphics.DrawLines (p, points);
\r
292 t.Graphics.DrawLines (Pens.White, points);
\r
294 Assert.IsTrue (t.Compare (TOLERANCE));
\r
297 public void LineJoinTest_MiterClipped_3 () {
\r
298 p.LineJoin = LineJoin.MiterClipped;
\r
299 Point [] points = new Point [] {
\r
300 new Point(50, 217), new Point (100, 100),
\r
301 new Point (150, 217)};
\r
303 t.Graphics.DrawLines (p, points);
\r
304 t.Graphics.DrawLines (Pens.White, points);
\r
306 Assert.IsTrue (t.Compare (TOLERANCE));
\r
310 #region "LineJoin Bevel"
\r
312 public void LineJoinTest_Bevel_1 () {
\r
313 p.LineJoin = LineJoin.Bevel;
\r
314 Point [] points = new Point [] {
\r
315 new Point(90, 217), new Point (115, 55),
\r
316 new Point (140, 217)};
\r
318 t.Graphics.DrawLines (p, points);
\r
319 t.Graphics.DrawLines (Pens.White, points);
\r
321 Assert.IsTrue (t.Compare (TOLERANCE));
\r
324 public void LineJoinTest_Bevel_2 () {
\r
325 p.LineJoin = LineJoin.Bevel;
\r
326 Point [] points = new Point [] {
\r
327 new Point(110, 217), new Point (120, 75),
\r
328 new Point (130, 217)};
\r
330 t.Graphics.DrawLines (p, points);
\r
331 t.Graphics.DrawLines (Pens.White, points);
\r
333 Assert.IsTrue (t.Compare (TOLERANCE));
\r
336 public void LineJoinTest_Bevel_3 () {
\r
337 p.LineJoin = LineJoin.Bevel;
\r
338 Point [] points = new Point [] {
\r
339 new Point(50, 217), new Point (100, 100),
\r
340 new Point (150, 217)};
\r
342 t.Graphics.DrawLines (p, points);
\r
343 t.Graphics.DrawLines (Pens.White, points);
\r
345 Assert.IsTrue (t.Compare (TOLERANCE));
\r
348 public void LineJoinTest_Bevel_4 () {
\r
349 p.LineJoin = LineJoin.Bevel;
\r
350 Point [] points = new Point [] {
\r
351 new Point(143, 210), new Point (170, 100),
\r
352 new Point (180, 20)};
\r
354 t.Graphics.DrawLines (p, points);
\r
355 t.Graphics.DrawLines (Pens.White, points);
\r
357 Assert.IsTrue (t.Compare (TOLERANCE));
\r
360 public void LineJoinTest_Bevel_5 () {
\r
361 p.LineJoin = LineJoin.Bevel;
\r
362 Point [] points = new Point [] {
\r
363 new Point(50, 100), new Point (150, 100),
\r
364 new Point (150, 20), new Point (200, 20)};
\r
366 t.Graphics.DrawLines (p, points);
\r
367 t.Graphics.DrawLines (Pens.White, points);
\r
369 Assert.IsTrue (t.Compare (TOLERANCE));
\r
373 #region PenAlignment
\r
375 public void PenAlignmentTest_1 () {
\r
376 Assert.AreEqual (PenAlignment.Center, p.Alignment);
\r
377 Point [] points = new Point [] {
\r
378 new Point (30, 30), new Point (100, 100), new Point (170, 30),
\r
379 new Point (170, 200), new Point (30, 200)};
\r
380 GraphicsPath path = new GraphicsPath ();
\r
381 path.AddPolygon (points);
\r
384 t.Graphics.DrawPath (p, path);
\r
385 t.Graphics.DrawPath (Pens.White, path);
\r
387 Assert.IsTrue (t.Compare (TOLERANCE));
\r
390 public void PenAlignmentTest_2 () {
\r
391 Point [] points = new Point [] {
\r
392 new Point (30, 30), new Point (100, 100), new Point (170, 30),
\r
393 new Point (170, 200), new Point (30, 200)};
\r
394 GraphicsPath path = new GraphicsPath ();
\r
395 path.AddPolygon (points);
\r
398 p.Alignment = PenAlignment.Left;
\r
399 t.Graphics.DrawPath (p, path);
\r
400 t.Graphics.DrawPath (Pens.White, path);
\r
402 Assert.IsTrue (t.Compare (TOLERANCE));
\r
406 [Category ("NotWorking")]
\r
407 public void PenAlignmentTest_3 () {
\r
408 Point [] points = new Point [] {
\r
409 new Point (30, 30), new Point (100, 100), new Point (170, 30),
\r
410 new Point (170, 200), new Point (30, 200)};
\r
411 GraphicsPath path = new GraphicsPath ();
\r
412 path.AddPolygon (points);
\r
415 p.Alignment = PenAlignment.Inset;
\r
416 t.Graphics.DrawPath (p, path);
\r
417 t.Graphics.DrawPath (Pens.White, path);
\r
419 Assert.IsTrue (t.Compare (TOLERANCE));
\r
423 public void PenAlignmentTest_4 () {
\r
424 Point [] points = new Point [] {
\r
425 new Point (30, 30), new Point (100, 100), new Point (170, 30),
\r
426 new Point (170, 200), new Point (30, 200)};
\r
427 GraphicsPath path = new GraphicsPath ();
\r
428 path.AddPolygon (points);
\r
431 p.Alignment = PenAlignment.Outset;
\r
432 t.Graphics.DrawPath (p, path);
\r
433 t.Graphics.DrawPath (Pens.White, path);
\r
435 Assert.IsTrue (t.Compare (TOLERANCE));
\r
439 public void PenAlignmentTest_5 () {
\r
440 Point [] points = new Point [] {
\r
441 new Point (30, 30), new Point (100, 100), new Point (170, 30),
\r
442 new Point (170, 200), new Point (30, 200)};
\r
443 GraphicsPath path = new GraphicsPath ();
\r
444 path.AddPolygon (points);
\r
447 p.Alignment = PenAlignment.Right;
\r
448 t.Graphics.DrawPath (p, path);
\r
449 t.Graphics.DrawPath (Pens.White, path);
\r
451 Assert.IsTrue (t.Compare (TOLERANCE));
\r
457 public void ColorTest_1 () {
\r
458 Assert.AreEqual (Color.Blue, p.Color);
\r
460 t.Graphics.DrawLine (p, 10, 100, 230, 100);
\r
462 Assert.IsTrue (t.Compare (TOLERANCE));
\r
465 public void ColorTest_2 () {
\r
466 p.Color = Color.Red;
\r
468 t.Graphics.DrawLine (p, 10, 100, 230, 100);
\r
470 Assert.IsTrue (t.Compare (TOLERANCE));
\r
473 public void ColorTest_3 () {
\r
474 p.Color = Color.BurlyWood;
\r
476 t.Graphics.DrawLine (p, 10, 100, 230, 100);
\r
478 Assert.IsTrue (t.Compare (TOLERANCE));
\r
481 public void ColorTest_4 () {
\r
482 p.Color = Color.FromArgb (100, 120, 255);
\r
484 t.Graphics.DrawLine (p, 10, 100, 230, 100);
\r
486 Assert.IsTrue (t.Compare (TOLERANCE));
\r
489 public void ColorTest_5 () {
\r
490 p.Color = Color.FromArgb (128, Color.White);
\r
492 t.Graphics.DrawLine (p, 10, 100, 230, 100);
\r
494 Assert.IsTrue (t.Compare (TOLERANCE));
\r
500 public void MitterLimit_1 () {
\r
501 p.LineJoin = LineJoin.MiterClipped;
\r
502 Point [] points = new Point [] {new Point (0,30), new Point (180, 30),
\r
503 new Point (0, 90)};
\r
506 Assert.AreEqual (10F, p.MiterLimit);
\r
507 t.Graphics.DrawLines (p, points);
\r
508 t.Graphics.DrawLines (Pens.White, points);
\r
510 Assert.IsTrue (t.Compare (TOLERANCE));
\r
513 public void MitterLimit_2 () {
\r
515 p.LineJoin = LineJoin.MiterClipped;
\r
516 Point [] points = new Point [] {new Point (0,30), new Point (180, 30),
\r
517 new Point (0, 120)};
\r
520 t.Graphics.DrawLines (p, points);
\r
521 t.Graphics.DrawLines (Pens.White, points);
\r
523 Assert.IsTrue (t.Compare (TOLERANCE));
\r
529 public void Transform () {
\r
530 p.ScaleTransform (0.5F, 2);
\r
531 t.Graphics.DrawArc (p, 70, 70, 100, 100, 0, 360);
\r
532 t.Graphics.DrawArc (Pens.White, 70, 70, 100, 100, 0, 360);
\r
534 Assert.IsTrue (t.Compare (TOLERANCE));
\r
538 #region Line StartCap
\r
540 public void StartCap_Flat() {
\r
541 Assert.AreEqual(LineCap.Flat, p.StartCap);
\r
542 p.StartCap = LineCap.Flat;
\r
544 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
545 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
547 Assert.IsTrue (t.Compare (TOLERANCE));
\r
550 [Category ("NotWorking")]
\r
551 public void StartCap_Round() {
\r
552 p.StartCap = LineCap.Round;
\r
554 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
555 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
557 Assert.IsTrue (t.Compare (TOLERANCE));
\r
560 [Category ("NotWorking")]
\r
561 public void StartCap_Square() {
\r
562 p.StartCap = LineCap.Square;
\r
564 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
565 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
567 Assert.IsTrue (t.Compare (TOLERANCE));
\r
570 public void StartCap_AnchorMask() {
\r
571 p.StartCap = LineCap.AnchorMask;
\r
573 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
574 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
576 Assert.IsTrue (t.Compare (TOLERANCE));
\r
579 public void StartCap_ArrowAnchor() {
\r
580 p.StartCap = LineCap.ArrowAnchor;
\r
582 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
583 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
585 Assert.IsTrue (t.Compare (TOLERANCE));
\r
588 [Category ("NotWorking")]
\r
589 public void StartCap_DiamondAnchor() {
\r
590 p.StartCap = LineCap.DiamondAnchor;
\r
592 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
593 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
595 Assert.IsTrue (t.Compare (TOLERANCE));
\r
598 public void StartCap_NoAnchor() {
\r
599 p.StartCap = LineCap.NoAnchor;
\r
601 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
602 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
604 Assert.IsTrue (t.Compare (TOLERANCE));
\r
607 [Category ("NotWorking")]
\r
608 public void StartCap_RoundAnchor() {
\r
609 p.StartCap = LineCap.RoundAnchor;
\r
611 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
612 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
614 Assert.IsTrue (t.Compare (TOLERANCE));
\r
617 [Category ("NotWorking")]
\r
618 public void StartCap_SquareAnchor() {
\r
619 p.StartCap = LineCap.SquareAnchor;
\r
621 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
622 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
624 Assert.IsTrue (t.Compare (TOLERANCE));
\r
627 public void StartCap_Triangle() {
\r
628 p.StartCap = LineCap.Triangle;
\r
630 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
631 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
633 Assert.IsTrue (t.Compare (TOLERANCE));
\r
636 public void StartCap_Custom() {
\r
637 p.StartCap = LineCap.Custom;
\r
639 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
640 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
642 Assert.IsTrue (t.Compare (TOLERANCE));
\r
646 #region Line EndCap
\r
648 public void EndCap_Flat()
\r
650 Assert.AreEqual(LineCap.Flat, p.EndCap);
\r
651 p.EndCap = LineCap.Flat;
\r
653 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
654 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
656 Assert.IsTrue (t.Compare (TOLERANCE));
\r
659 [Category ("NotWorking")]
\r
660 public void EndCap_Round()
\r
662 p.EndCap = LineCap.Round;
\r
664 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
665 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
667 Assert.IsTrue (t.Compare (TOLERANCE));
\r
670 [Category ("NotWorking")]
\r
671 public void EndCap_Square() {
\r
672 p.EndCap = LineCap.Square;
\r
674 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
675 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
677 Assert.IsTrue (t.Compare (TOLERANCE));
\r
680 [Category ("NotWorking")]
\r
681 public void EndCap_AnchorMask() {
\r
682 p.EndCap = LineCap.AnchorMask;
\r
684 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
685 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
687 Assert.IsTrue (t.Compare (TOLERANCE));
\r
690 [Category ("NotWorking")]
\r
691 public void EndCap_ArrowAnchor() {
\r
692 p.EndCap = LineCap.ArrowAnchor;
\r
694 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
695 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
697 Assert.IsTrue (t.Compare (TOLERANCE));
\r
700 public void EndCap_DiamondAnchor() {
\r
701 p.EndCap = LineCap.DiamondAnchor;
\r
703 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
704 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
706 Assert.IsTrue (t.Compare (TOLERANCE));
\r
709 [Category ("NotWorking")]
\r
710 public void EndCap_NoAnchor() {
\r
711 p.EndCap = LineCap.NoAnchor;
\r
713 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
714 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
716 Assert.IsTrue (t.Compare (TOLERANCE));
\r
719 [Category ("NotWorking")]
\r
720 public void EndCap_RoundAnchor() {
\r
721 p.EndCap = LineCap.RoundAnchor;
\r
723 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
724 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
726 Assert.IsTrue (t.Compare (TOLERANCE));
\r
729 public void EndCap_SquareAnchor() {
\r
730 p.EndCap = LineCap.SquareAnchor;
\r
732 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
733 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
735 Assert.IsTrue (t.Compare (TOLERANCE));
\r
738 [Category ("NotWorking")]
\r
739 public void EndCap_Triangle() {
\r
740 p.EndCap = LineCap.Triangle;
\r
742 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
743 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
745 Assert.IsTrue (t.Compare (TOLERANCE));
\r
748 [Category ("NotWorking")]
\r
749 public void EndCap_Custom() {
\r
750 p.EndCap = LineCap.Custom;
\r
752 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
753 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
755 Assert.IsTrue (t.Compare (TOLERANCE));
\r
759 #region Basic LineCaps StartEnd
\r
761 public void StartEndCapBasic_Flat() {
\r
762 Assert.AreEqual(LineCap.Flat, p.StartCap);
\r
765 p.EndCap = LineCap.Flat;
\r
766 p.StartCap = LineCap.Flat;
\r
767 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
768 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
770 Assert.IsTrue (t.Compare (TOLERANCE));
\r
773 public void StartEndCapBasic_Round() {
\r
775 p.EndCap = LineCap.Round;
\r
776 p.StartCap = LineCap.Round;
\r
777 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
778 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
780 Assert.IsTrue (t.Compare (TOLERANCE));
\r
783 public void StartEndCapBasic_Square() {
\r
785 p.EndCap = LineCap.Square;
\r
786 p.StartCap = LineCap.Square;
\r
787 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
788 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
790 Assert.IsTrue (t.Compare (TOLERANCE));
\r
793 public void SetLineCap_Flat() {
\r
794 Assert.AreEqual(LineCap.Flat, p.StartCap);
\r
797 p.SetLineCap(LineCap.Flat, LineCap.Flat, DashCap.Flat);
\r
798 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
799 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
801 Assert.IsTrue (t.Compare (TOLERANCE));
\r
804 public void SetLineCap_Round() {
\r
806 p.SetLineCap(LineCap.Round, LineCap.Round, DashCap.Round);
\r
807 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
808 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
810 Assert.IsTrue (t.Compare (TOLERANCE));
\r
813 public void SetLineCap_Square() {
\r
815 p.SetLineCap(LineCap.Square, LineCap.Square, DashCap.Flat);
\r
816 t.Graphics.DrawLine (p, 50, 100, 150, 100);
\r
817 t.Graphics.DrawLine (Pens.White, 50, 100, 150, 100);
\r
819 Assert.IsTrue (t.Compare (TOLERANCE));
\r