2010-07-15 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Thu, 15 Jul 2010 18:40:52 +0000 (18:40 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Thu, 15 Jul 2010 18:40:52 +0000 (18:40 -0000)
* LinearGradientBrushTest.cs: Add test case for #537396 (empty rects)

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

mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/ChangeLog
mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/LinearGradientBrushTest.cs

index abbf6996b9f69db2346954cc142c9fe00487a80a..0e77465c975e2c56613ceca13b2eeac76e16ebeb 100644 (file)
@@ -1,3 +1,7 @@
+2010-07-15  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * LinearGradientBrushTest.cs: Add test case for #537396 (empty rects)
+
 2009-08-28  Atsushi Enomoto  <atsushi@ximian.com>
 
        * TestBlend.cs, TestMatrix.cs : nunit test upgrade to modern style.
index bdc11fec5bad14662d24115a4d293375d44d9384..bb97b81288c7fb4ecd3a95d24a5255f6d26502e3 100644 (file)
@@ -894,5 +894,23 @@ namespace MonoTests.System.Drawing.Drawing2D {
                {
                        default_brush.Blend = null;
                }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void ZeroWidthRectangle ()
+               {
+                       Rectangle r = new Rectangle (10, 10, 0, 10);
+                       Assert.AreEqual (0, r.Width, "Width");
+                       new LinearGradientBrush (r, Color.Red, Color.Blue, LinearGradientMode.Vertical);
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void ZeroHeightRectangleF ()
+               {
+                       RectangleF r = new RectangleF (10.0f, 10.0f, 10.0f, 0.0f);
+                       Assert.AreEqual (0.0f, r.Height, "Height");
+                       new LinearGradientBrush (r, Color.Red, Color.Blue, LinearGradientMode.Vertical);
+               }
        }
 }