Author: everaldo
Date: 2006-12-04 08:02:58 -0500 (Mon, 04 Dec 2006)
New Revision: 68944

Modified:
   trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/LabelTest.cs
Log:
2006-12-04  Everaldo Canuto  <[EMAIL PROTECTED]>

        * LabelTest.cs: Add tests for sizes, test for bug #80137.



Modified: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2006-12-04 12:19:24 UTC (rev 68943)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2006-12-04 13:02:58 UTC (rev 68944)
@@ -1,3 +1,7 @@
+2006-12-04  Everaldo Canuto  <[EMAIL PROTECTED]>
+
+       * LabelTest.cs: Add tests for sizes, test for bug #80137.
+
 2006-12-01  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>
 
        * MdiFormTest.cs: All current NotWorking tests are 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-12-04 12:19:24 UTC (rev 68943)
+++ 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/LabelTest.cs    
    2006-12-04 13:02:58 UTC (rev 68944)
@@ -50,6 +50,49 @@
 
                        f.Dispose ();
                }
+               
+               [Test]
+               public void SizesTest ()
+               {
+                       Form myform = new Form ();
+                       Label l1 = new Label (); l1.Text = "Test";
+                       Label l2 = new Label (); l2.Text = "Test";
+                       Label l3 = new Label (); l3.Text = "Test three";
+                       Label l4 = new Label (); l4.Text = String.Format ("Test 
four{0}with line breaks", Environment.NewLine);
+                       myform.Controls.Add (l1);
+                       myform.Controls.Add (l2);
+                       myform.Controls.Add (l3);
+                       myform.Controls.Add (l4);
+                       myform.Show ();
+                       
+                       l2.Font = new Font (l1.Font.FontFamily, l1.Font.Size + 
5, l1.Font.Style);
+                       
+                       // Height: autosize = false
+                       Assert.AreEqual (l1.Height, l2.Height, "#1");
+                       Assert.AreEqual (l1.Height, l3.Height, "#2");
+                       Assert.AreEqual (l1.Height, l4.Height, "#3");
+                       
+                       // Width: autosize = false                      
+                       Assert.AreEqual (l1.Width, l2.Width, "#4");
+                       Assert.AreEqual (l1.Width, l3.Width, "#5");
+                       Assert.AreEqual (l1.Width, l4.Width, "#6");
+                       
+                       l1.AutoSize = true; 
+                       l2.AutoSize = true;
+                       l3.AutoSize = true;
+                       l4.AutoSize = true;
+                       
+                       // Height: autosize = false
+                       Assert.IsFalse (l1.Height.Equals (l2.Height), "#7");
+                       Assert.IsTrue (l1.Height.Equals (l3.Height), "#8");
+                       Assert.IsTrue (l1.Height.Equals (l4.Height), "#9");
+                       
+                       // Width: autosize = false
+                       Assert.IsFalse (l1.Width.Equals (l2.Width), "#10");
+                       Assert.IsFalse (l1.Width.Equals (l3.Width), "#11");
+                       
+                       myform.Dispose();
+               }
 
                [Test]
                public void BoundsTest ()

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to