Author: gonzalo
Date: 2005-09-28 04:00:26 -0400 (Wed, 28 Sep 2005)
New Revision: 50930
Modified:
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/CalendarTest.cs
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
Log:
2005-09-28 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* CalendarTest.cs: added test to check for ID and base attributes being
copied from the calendar into the table.
Modified:
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/CalendarTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/CalendarTest.cs
2005-09-28 07:39:08 UTC (rev 50929)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/CalendarTest.cs
2005-09-28 08:00:26 UTC (rev 50930)
@@ -61,6 +61,19 @@
base.Render (writer);
return writer.InnerWriter.ToString ();
}
+
+ bool cs_called;
+ public bool CS_Called {
+ get { return cs_called; }
+ set { cs_called = value; }
+ }
+
+ protected override Style CreateControlStyle ()
+ {
+ // Console.WriteLine (Environment.StackTrace);
+ cs_called = true;
+ return base.CreateControlStyle ();
+ }
}
@@ -603,5 +616,44 @@
string s = p.Render();
Assert.IsTrue (s.IndexOf ("color:White") != 1 &&
s.IndexOf ("background-color:Silver") != -1, "A1");
}
+
+ [Test]
+ public void HaveID ()
+ {
+ PokerCalendar p = new PokerCalendar ();
+ p.ID = "hola";
+ p.TodaysDate = new DateTime (2005, 8, 4);
+ p.SelectedDate = p.TodaysDate;
+ string s = p.Render();
+ Assert.IsTrue (s.IndexOf ("id=\"hola\"") != -1, "#01");
+ }
+
+ /*
+ * Not meant to be run. Just to get a stack trace.
+ [Test]
+ public void NoCreateStyleCollection ()
+ {
+ PokerCalendar p = new PokerCalendar ();
+ p.ID = "hola";
+ p.TodaysDate = new DateTime (2005, 8, 4);
+ p.SelectedDate = p.TodaysDate;
+ string s = p.Render();
+ Assert.IsTrue (p.CS_Called == false, "#01");
+ }
+ */
+
+ [Test]
+ public void HaveBaseAttributes ()
+ {
+ PokerCalendar p = new PokerCalendar ();
+ p.ID = "hola";
+ p.ToolTip = "adios";
+ p.TodaysDate = new DateTime (2005, 8, 4);
+ p.SelectedDate = p.TodaysDate;
+ string s = p.Render();
+ Assert.IsTrue (s.IndexOf ("adios") != -11, "#01");
+ Assert.IsTrue (p.CS_Called == false, "#01");
+ }
}
}
+
Modified: trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
2005-09-28 07:39:08 UTC (rev 50929)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
2005-09-28 08:00:26 UTC (rev 50930)
@@ -1,5 +1,10 @@
2005-09-28 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+ * CalendarTest.cs: added test to check for ID and base attributes being
+ copied from the calendar into the table.
+
+2005-09-28 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
* PagedDataSourceTest.cs: nullref is throw on null DataSource.
2005-09-28 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches