~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/Printing/Shapes/RectangleShapeFixture.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using System.Drawing;
 
6
using System.Drawing.Drawing2D;
 
7
 
 
8
using ICSharpCode.Reports.Core.Test.TestHelpers;
 
9
using NUnit.Framework;
 
10
 
 
11
namespace ICSharpCode.Reports.Core.Test.Printing.Shapes
 
12
{
 
13
        [TestFixture]
 
14
        public class RectangleShapeFixture:ConcernOf<RectangleShape>
 
15
        {
 
16
                [Test]
 
17
                public void CreateLineShape()
 
18
                {
 
19
                        RectangleShape ls = new RectangleShape();
 
20
                        Assert.NotNull(ls);
 
21
                }
 
22
                
 
23
                
 
24
                [Test]
 
25
                [ExpectedException(typeof(NotImplementedException))]
 
26
                public void RectangleThrow()
 
27
                {
 
28
                        Point from = new Point (1,1);
 
29
                        Point to = new Point (10,10);
 
30
                        GraphicsPath p = Sut.CreatePath(from,to);
 
31
                }
 
32
                
 
33
                
 
34
                [Test]
 
35
                public void CheckGraphicsPathBounds()
 
36
                {
 
37
                        Point from = new Point(1,1);
 
38
                        Size size = new Size (10,10);
 
39
                        Rectangle rect = new Rectangle (from,size);
 
40
                        GraphicsPath p = Sut.CreatePath(rect);
 
41
                        RectangleF r = p.GetBounds();
 
42
                        Assert.AreEqual(from.X,r.Left);
 
43
                        Assert.AreEqual(from.Y,r.Top);
 
44
                        Assert.AreEqual(r.Size.Width + from.X, r.Right);
 
45
                        Assert.AreEqual(r.Size.Height + from.Y, r.Bottom);
 
46
                }
 
47
                
 
48
                
 
49
                [Test]
 
50
                public void CheckLastPointFromPath()
 
51
                {
 
52
                        Point from = new Point(1,1);
 
53
                        Size size = new Size (10,10);
 
54
                        Rectangle rect = new Rectangle (from,size);
 
55
                        GraphicsPath p = Sut.CreatePath(rect);
 
56
                        PointF last = p.GetLastPoint();
 
57
                        Assert.AreEqual(new Point (from.X ,from.Y + size.Height),  Point.Truncate(last));              
 
58
                }
 
59
                
 
60
                public override void Setup()
 
61
                {
 
62
                        Sut = new RectangleShape();
 
63
                }
 
64
        }
 
65
}