Browse Source

* ControlTest.cs: New test to check if, when controls don't have
a parent and are then reparented, their location is not changed.

2008-02-18 Andreia Gaita <[email protected]>

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

Andreia Gaita 18 years ago
parent
commit
54812addf3

+ 9 - 0
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog

@@ -1,3 +1,12 @@
+2008-02-18  Andreia Gaita <[email protected]> 
+
+	
+
+2008-02-18  Andreia Gaita <[email protected]>
+
+	* ControlTest.cs: New test to check if, when controls don't have 
+	a parent and are then reparented, their location is not changed.
+
 2008-02-11  Carlos Alberto Cortez <[email protected]>
 
 	* BindingTest.cs: New test for 2.0 DataSourceNullValue property -

+ 18 - 0
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs

@@ -1985,6 +1985,24 @@ namespace MonoTests.System.Windows.Forms
 		{
 			((Control) sender).Tag = false;
 		}
+		
+		[Test]
+		public void ControlReparentLocationTest ()
+		{
+			Form form = new Form ();
+			Label l = new Label ();
+			l.Location = new Point (0, 0);
+			form.Controls.Add (l);
+			form.Show ();
+			Assert.AreEqual (0, l.Left, "#A1");
+			Assert.AreEqual (0, l.Top, "#A2");
+			form.Hide ();
+			form.Controls.Remove (l);
+			form.Show ();
+			form.Controls.Add (l);
+			Assert.AreEqual (0, l.Left, "#A3");
+			Assert.AreEqual (0, l.Top, "#A4");
+		}
 
 #if NET_2_0
 		[Test]