Author: gonzalo
Date: 2005-12-05 17:37:08 -0500 (Mon, 05 Dec 2005)
New Revision: 53953
Modified:
trunk/mcs/class/System.Web/Test/System.Web.UI/ChangeLog
trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
Log:
2005-12-05 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* ControlTest.cs: new tests to prove that Control uses its own
ControlCollection field instead of the Controls property when rendering.
Modified: trunk/mcs/class/System.Web/Test/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI/ChangeLog 2005-12-05
21:30:36 UTC (rev 53952)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI/ChangeLog 2005-12-05
22:37:08 UTC (rev 53953)
@@ -1,3 +1,8 @@
+2005-12-05 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+ * ControlTest.cs: new tests to prove that Control uses its own
+ ControlCollection field instead of the Controls property when rendering.
+
2005-11-29 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* ControlCollectionTest.cs: new tests.
Modified: trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
2005-12-05 21:30:36 UTC (rev 53952)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
2005-12-05 22:37:08 UTC (rev 53953)
@@ -118,6 +118,34 @@
Assert.IsNull (nc.ID, "null-2");
Assert.IsTrue (-1 != control.UniqueID.IndexOfAny (new
char [] {':', '$' }), "separator");
}
+
+ class DerivedControl : Control {
+ ControlCollection coll;
+
+ public DerivedControl ()
+ {
+ coll = new ControlCollection (this);
+ }
+
+ public override ControlCollection Controls {
+ get { return coll; }
+ }
+ }
+
+ // From bug #76919: Control uses _controls instead of
+ // Controls when RenderChildren is called.
+ [Test]
+ public void Controls1 ()
+ {
+ DerivedControl derived = new DerivedControl ();
+ derived.Controls.Add (new LiteralControl ("hola"));
+ StringWriter sw = new StringWriter ();
+ HtmlTextWriter htw = new HtmlTextWriter (sw);
+ derived.RenderControl (htw);
+ string result = sw.ToString ();
+
+ Assert.AreEqual ("", result, "#01");
+ }
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches