Author: toshok
Date: 2006-11-09 15:15:54 -0500 (Thu, 09 Nov 2006)
New Revision: 67635
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/LabelTest.cs
Log:
we pass this test now
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/LabelTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/LabelTest.cs
2006-11-09 20:15:35 UTC (rev 67634)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/LabelTest.cs
2006-11-09 20:15:54 UTC (rev 67635)
@@ -25,13 +25,32 @@
}
[Test]
- [Category ("NotWorking")]
public void PreferredSize ()
{
Label l = new Label();
Assert.AreEqual (16, l.PreferredHeight, "1");
+
+ // preferred width is 0 by default
Assert.AreEqual (0, l.PreferredWidth, "2");
+
+ // and after text is changed it's something else
+ l.Text = "hi";
+ Assert.IsTrue (l.PreferredWidth > 0, "3");
+
+ // now add it to a form and see
+ Form f = new Form ();
+ f.ShowInTaskbar = false;
+ l.Text = "";
+
+ f.Controls.Add (l);
+ f.Show ();
+ Assert.AreEqual (0, l.PreferredWidth, "4");
+
+ l.Text = "hi";
+ Assert.IsTrue (l.PreferredWidth > 0, "5");
+
+ f.Dispose ();
}
[Test]
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches