Author: spouliot
Date: 2007-04-02 11:32:00 -0400 (Mon, 02 Apr 2007)
New Revision: 75283
Modified:
trunk/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
trunk/mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs
Log:
2007-04-02 Sebastien Pouliot <[EMAIL PROTECTED]>
* TestFont.cs: Add test cases for GetHeight(Graphics) and
GetHeight(float) methods.
Modified: trunk/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
2007-04-02 14:46:40 UTC (rev 75282)
+++ trunk/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
2007-04-02 15:32:00 UTC (rev 75283)
@@ -1,3 +1,8 @@
+2007-04-02 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * TestFont.cs: Add test cases for GetHeight(Graphics) and
+ GetHeight(float) methods.
+
2007-03-30 Sebastien Pouliot <[EMAIL PROTECTED]>
* GDIPlusTest.cs: Add pen test case to check for #81266 (note: will
Modified: trunk/mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs
===================================================================
--- trunk/mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs
2007-04-02 14:46:40 UTC (rev 75282)
+++ trunk/mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs
2007-04-02 15:32:00 UTC (rev 75283)
@@ -1,13 +1,13 @@
//
// Test Font class testing unit
//
-// Author:
+// Authors:
+// Jordi Mas i Hernandez, [EMAIL PROTECTED]
+// Peter Dennis Bartok, [EMAIL PROTECTED]
+// Sebastien Pouliot <[EMAIL PROTECTED]>
//
-// Jordi Mas i Hernandez, [EMAIL PROTECTED]
-// Peter Dennis Bartok, [EMAIL PROTECTED]
-//
// (C) 2003 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -28,6 +28,7 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+
using NUnit.Framework;
using System;
using System.Drawing;
@@ -577,5 +578,30 @@
// on the OS. This test is written for Windows.
Font f = new Font ("Monotype Corsiva", 8,
FontStyle.Regular);
}
+
+ [Test]
+ public void GetHeight_Float ()
+ {
+ using (Font f = new Font (name, 12.5f)) {
+ Assert.AreEqual (0, f.GetHeight (0), "0");
+ }
+ }
+
+ [Test]
+ public void GetHeight_Graphics ()
+ {
+ using (Bitmap bmp = new Bitmap (10, 10)) {
+ using (Graphics g = Graphics.FromImage (bmp)) {
+ using (Font f = new Font (name, 12.5f))
{
+ float expected = f.GetHeight
(g.DpiY);
+ Assert.AreEqual (expected,
f.GetHeight (g), 0.01f, "Default");
+ g.ScaleTransform (2, 4);
+ Assert.AreEqual (expected,
f.GetHeight (g), 0.01f, "ScaleTransform");
+ g.PageScale = 3;
+ Assert.AreEqual (expected,
f.GetHeight (g), 0.01f, "PageScale");
+ }
+ }
+ }
+ }
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches