(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / System.Drawing / Test / System.Drawing / TestPointF.cs
blob7685d671c264c295990f600efe23978a19d113cb
1 // Tests for System.Drawing.PointF.cs
2 //
3 // Author:
4 // Ravindra (rkumar@novell.com)
5 //
7 //
8 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
9 //
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:
17 //
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
20 //
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;
32 using System;
33 using System.Drawing;
35 namespace MonoTests.System.Drawing
37 [TestFixture]
38 public class PointFTest : Assertion
40 PointF pt11_99;
41 PointF pt11_0;
42 PointF pt0_11;
44 [TearDown]
45 public void TearDown () {}
47 [SetUp]
48 public void SetUp ()
50 pt11_99 = new PointF (1.1F, 9.9F);
51 pt11_0 = new PointF (1.1F, 0F);
52 pt0_11 = new PointF (0F, 1.1F);
55 [Test]
56 public void TestConstructors ()
58 PointF pt = new PointF (1.5F, 5.8F);
59 AssertEquals ("C#1", 1.5F, pt.X);
60 AssertEquals ("C#2", 5.8F, pt.Y);
63 [Test]
64 public void TestEmptyField ()
66 PointF pt = new PointF (0.0F, 0.0F);
67 AssertEquals ("EMP#1", pt, PointF.Empty);
70 [Test]
71 public void TestProperties ()
73 PointF pt = new PointF (0.0F, 0.0F);
75 Assert ("P#1", pt.IsEmpty);
76 Assert ("P#2", ! pt11_99.IsEmpty);
77 AssertEquals ("P#3", 1.1F, pt11_0.X);
78 AssertEquals ("P#4", 1.1F, pt0_11.Y);
81 [Test]
82 public void TestEquals ()
84 AssertEquals ("EQ#1", pt11_99, pt11_99);
85 AssertEquals ("EQ#2", pt11_99, new PointF (1.1F, 9.9F));
86 Assert ("EQ#3", ! pt11_99.Equals (pt11_0));
87 Assert ("EQ#4", ! pt11_99.Equals (pt0_11));
88 Assert ("EQ#5", ! pt11_0.Equals (pt0_11));
92 [Test]
93 public void TestAddition ()
95 AssertEquals ("ADD#1", pt11_0, pt11_0 + new Size (0, 0));
96 AssertEquals ("ADD#2", pt0_11, pt0_11 + new Size (0, 0));
99 [Test]
100 public void TestEqualityOp ()
102 Assert ("EOP#1", pt11_99 == pt11_99);
103 Assert ("EOP#2", pt11_99 == new PointF (1.1F, 9.9F));
104 Assert ("EOP#3", ! (pt11_99 == pt11_0));
105 Assert ("EOP#4", ! (pt11_99 == pt0_11));
106 Assert ("EOP#5", ! (pt11_0 == pt0_11));
109 [Test]
110 public void TestInequalityOp ()
112 Assert ("IOP#1", ! (pt11_99 != pt11_99));
113 Assert ("IOP#2", ! (pt11_99 != new PointF (1.1F, 9.9F)));
114 Assert ("IOP#3", pt11_99 != pt11_0);
115 Assert ("IOP#4", pt11_99 != pt0_11);
116 Assert ("IOP#5", pt11_0 != pt0_11);
119 [Test]
120 public void TestSubtraction ()
122 AssertEquals ("SUB#1", pt11_0, pt11_0 - new Size (0, 0));
123 AssertEquals ("SUB#2", pt0_11, pt0_11 - new Size (0, 0));