2008-01-08 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Tue, 8 Jan 2008 13:54:17 +0000 (13:54 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Tue, 8 Jan 2008 13:54:17 +0000 (13:54 -0000)
* TestFont.cs: Add test case for GetHashCode from Jonathan Pobst
for bug #351647

svn path=/trunk/mcs/; revision=92451

mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs

index 9d897b020b3ccafdcd0707db48a127e3bf9fdc5d..98e32a271e0cb0f465c144f3a1b2badcf1075ace 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-08  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * TestFont.cs: Add test case for GetHashCode from Jonathan Pobst
+       for bug #351647
+
 2007-12-19  Sebastien Pouliot  <sebastien@ximian.com>
 
        * TestGraphics.cs: Add test case on TransformPoints for #349800.
index 57174560eac10631ae1dc1b1cb98044cdb553d86..d2c496192e1399afa7f47c82a2548904cc3d5e91 100644 (file)
@@ -603,5 +603,16 @@ namespace MonoTests.System.Drawing{
                                }
                        }
                }
+
+               [Test]
+               public void FontUniqueHashCode ()
+               {
+                       Font f1 = new Font ("Arial", 14);
+                       Font f2 = new Font ("Arial", 12);
+                       Font f3 = new Font (f1, FontStyle.Bold);
+
+                       Assert.IsFalse (f1.GetHashCode () == f2.GetHashCode (), "1) Fonts with different sizes should have different HashCodes");
+                       Assert.IsFalse (f1.GetHashCode () == f3.GetHashCode (), "2) Fonts with different styles should have different HashCodes");
+               }
        }
 }