Browse Source

add a unit test dealing with disposing of a form's owner

svn path=/trunk/mcs/; revision=67964
Chris Toshok 19 years ago
parent
commit
a930661640

+ 13 - 0
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs

@@ -215,6 +215,19 @@ namespace MonoTests.System.Windows.Forms
 			Assert.IsFalse (myform.IsDisposed, "A10");
 		}
 
+		[Test]
+		public void DisposeOwnerTest ()
+		{
+			Form f1 = new Form ();
+			Form f2 = new Form ();
+
+			f2.Owner = f1;
+
+			f1.Dispose ();
+
+			Assert.IsNull (f2.Owner, "1");
+		}
+
 		[Test]
 		[ExpectedException (typeof (ObjectDisposedException))]
 		public void AccessDisposedForm ()